[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to use Visual Basic code from VC++

Posted on 2003-11-26
5
Medium Priority
?
360 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
4 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 800 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

831 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