VBA to VB.NET communication

p_nivalis

Active member
Joined
Oct 1, 2004
Messages
33
Programming Experience
5-10
I am working on a complicated Microsoft Excel application which needs to send data (namely, strings) to a VB.NET application (.NET v2.0). I am not interested in using any type of intermediate storage to accomplish this task (no writing to files, creating databases, using the registry, etc...). I simply want to pipe data directly from a VBA module to a VB.NET application.

Additionally, the data is NOT available on an Excel worksheet--it is a variable in a module. Therefore, using VB.NET to read from an open Excel worksheet is not a viable solution.

Is this possible? If so, how does one accomplish this task?

Thanks so much for your help!
 
Additionally, the data is NOT available on an Excel worksheet--it is a variable in a module. Therefore, using VB.NET to read from an open Excel worksheet is not a viable solution.


I'm no excel guru, but i have no idea what 'it is a variable in a module' means. A little more detail would be helpful here.
 
I apologize for being unclear. My Excel application is the client in a client/server application. Users are required to log in to use the Excel worksheet. Once authenticated against a remote database, the Excel application stores the login name locally.

I then need to send this information to a VB.NET exe (guaranteed to be running on the user's computer). The login information is not ever stored on disk for fear of manipulation.

Basically, I need to send data from VBA to VB.NET, when the data is unreadable from VB.NET.
 
Firstly you need to start thinking the other way around...

A VB.Net .exe has to retrieve the information from the specified file, not the other way around.

Secondly what kind of file is this information being stored in. If it is just simple text, binary, etc.. then the System.IO namespace has everything that you need.
 
Alright the VB.NET application will retrieve the information from Excel. But the data that needs to be retrieved is not stored in any file, it is stored in a variable declared in an Excel (VBA) function.

So, I need to use VB.NET to read VBA variables.
 
Oh i see, you want to read compiled VBA code from VB.Net. I think you may be out of luck on this one. I don't know of any engine that could make vb.net understand compiled VBA. How about a VB.Net addin to excel, that could raise and event in the VB.Net .exe and return the value you want? Just thinking out loud here, but i don't see an easy way of doing this.
 
Back
Top