Solved

How to use Visual Basic code from VC++

Posted on 2003-11-26
5
354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

734 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