Solved

How to use Visual Basic code from VC++

Posted on 2003-11-26
5
352 Views
Last Modified: 2013-11-25
hey all ,

I am quite new to Visual Studio environment can anyone tell me how to use Visual Basic code (macro) inside VC++.I am trying to program a standalone inplace of  a excel based application, the excel version currently has a few visual basic macros which do all the required computations. I want to use these macros from inside my VC++ code, how do I do it.  I think it can be done through a DLL ? but not sure how. Any solution/suggestions (a bit detailed  Pls am new to visual studio :) ). I am currently working on VC++.NET and code is in VB 6.0 .

Thanks in advance,
AM
0
Comment
Question by:AM15
  • 2
5 Comments
 
LVL 1

Expert Comment

by:vbs03
ID: 9830131
Hi,
    What u can do is depending on type of code impelemented in Excel VBA, try to create a corresponding ActiveX DLL/EXE.
In this DLL/EXE, based on the code create functions which will implement the Excel VBA code. Now u can reference this DLL/EXE in VC environment and create and object and directly reference the required function.

    If u need any further clarifications please state so.
Regards,
VBS
0
 

Author Comment

by:AM15
ID: 9862178
hi VBS,

Thanks for the reply but I didn't understand it completly. You mean to say that I need to create a DLL in VC which will call the VBA functions or Create a DLL in VB with all the functions ? After I create the DLL I can just instantiate the object and use the functions right ? could u please explain the above points.

Thanks
AM
0
 
LVL 1

Accepted Solution

by:
vbs03 earned 200 total points
ID: 9864444
AM15
What i meant to say was create all the DLL in VB, this is because the VBA code can be directly translated to VB due to similar syntax. Now u can reference this DLL in VC.
IF this is not clear I could provide some more details.

Regards,
VBS
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10286171
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: vbs03 {http:#9864444}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

756 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