•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 402,802 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,971 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 190 | Replies: 2
![]() |
•
•
Join Date: Jul 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Hi everyone!
I have a program written in C++ which already exports some data to Excel, on the other hand, I have another program written in VBA to analyse the data. I used to run them independent but now I would like to simplify them.
Is there a chance to run the program written in VBA from C++???
Thanks
I would appreciate any info or help!
Carlos
I have a program written in C++ which already exports some data to Excel, on the other hand, I have another program written in VBA to analyse the data. I used to run them independent but now I would like to simplify them.
Is there a chance to run the program written in VBA from C++???
Thanks
I would appreciate any info or help!
Carlos
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,839
Reputation:
Rep Power: 11
Solved Threads: 189
They will remain separate programs, but I think you are asking if your C++ program can automatically run the VBA program so that the user doesn't have to?
You have a variety of options. You can use system() (#include <cstdlib>).
On Windows you can use ShellExecuteEx() (there are examples on MS's site), and WaitForSingleObject() on the hProcess member of the SHELLEXECUTEINFO structure. (#include <windows.h>).
Or you can use CreateProcess() directly...
Hope this helps.
You have a variety of options. You can use system() (#include <cstdlib>).
system( "\"C:\\Program Files\\MyVBAProgram\\VBAProg.exe\"" );On Windows you can use ShellExecuteEx() (there are examples on MS's site), and WaitForSingleObject() on the hProcess member of the SHELLEXECUTEINFO structure. (#include <windows.h>).
Or you can use CreateProcess() directly...
Hope this helps.
•
•
Join Date: Jul 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Duoas
Cheers for the quick reply!
I'll give it a shot!
I know the 2 programs will remain separate but I only wanted to link them.
Cheers again
Carlos
Cheers for the quick reply!
I'll give it a shot!
I know the 2 programs will remain separate but I only wanted to link them.
Cheers again
Carlos
•
•
•
•
They will remain separate programs, but I think you are asking if your C++ program can automatically run the VBA program so that the user doesn't have to?
You have a variety of options. You can use system() (#include <cstdlib>).
system( "\"C:\\Program Files\\MyVBAProgram\\VBAProg.exe\"" );
On Windows you can use ShellExecuteEx() (there are examples on MS's site), and WaitForSingleObject() on the hProcess member of the SHELLEXECUTEINFO structure. (#include <windows.h>).
Or you can use CreateProcess() directly...
Hope this helps.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- VBA source code (Visual Basic 4 / 5 / 6)
- Using VBA with Access (was: Please Help!!!) (Visual Basic 4 / 5 / 6)
- Chart numbering frustration in VBA (Visual Basic 4 / 5 / 6)
- Need To Print PDF using VBA in Word (Visual Basic 4 / 5 / 6)
- VBA Date Format (Visual Basic 4 / 5 / 6)
- I need help using VBA for Word Macros (Windows NT / 2000 / XP / 2003)
Other Threads in the C++ Forum
- Previous Thread: Reading user input file into an array
- Next Thread: trouble using fstream with arrays



Linear Mode