Solved

calling a particular VB form from Excel

Posted on 1998-09-08
3
127 Views
Last Modified: 2010-04-30
I have a vb5 program that opens up an existing xl spreadsheet (ie, we are not in the vb shell anymore). However, I then want to return to vb and call up either form 1 or 2 in the vb shell, depending on what the user does in Excel. I have tried to put the hwnd value of both VB forms into excel when it loads, but excel only returns to the active VB window.
0
Comment
Question by:cotton
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
brunchey earned 50 total points
ID: 1433593
You might have to create more of an object-oriented way of doing this.  Try getting, or giving, a reference to excel of the actual VB application by making it an activex.exe and having publicly creatable objects.  But make sure that it is of the current instance of the application.  Then have two different methods that will allow provide the functionality that you are trying to incorporate.  
0
 

Author Comment

by:cotton
ID: 1433594
Thanks for such a prompt response, you have made me think about the problem in a different way. I'm working with heavy maths - would calling the DLL from Excel be as fast as VB compiled?
0
 
LVL 1

Expert Comment

by:brunchey
ID: 1433595
I am not an excel expert, but it should be resonably as quick
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now