Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert Excel VB code to .exe file

Status
Not open for further replies.

deltaair

IS-IT--Management
Nov 3, 2005
43
CH
I have some code that I wrote in Excel 2003, which doesn't really involve Excel,

I was wondering if there's a way I can convert this code into a .exe application file, and make that .exe a scheduled task or something like that. ??
 
I'm sorry but I'm new to this, I don't know where to look in the reference material you referred. Appreciate your help.

Thank you
 
I showed you where to find the main differences between VBA and VBS.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I'm sorry but I'm still confused, is it that code written in Excel is VBA, and only VB Script can be converted to .exe?
If so, then what do I need to convert my VBA EXCEL code to VB Script or a .exe file.

Can i just write, compile a VB Script File in Excel itself or what else do I need. I apologize for my naivety.
 
If you insist on .exe you have to buy a VB compiler.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
so could i use excel to make it a scheduled task instead ?
 
deltaair,
1) you can put your excel file in a scheduled task.
2) or you can convert your excel vba into a vbscript and put that in a scheduled task.
3) i'm not sure of melmitts solution since i have never used this product.
if you want number 2 or 3 then you will need to use the link that PHV provided to see what the differences are between the 2 languages.
if you are still stuck post the code where you are having the issue.
regards,
longhair
 
Actually, it is possible to pack script file to standalone "exe" for free in win 2k and above. The advantage is that the script remains hidden (however, it is not precise, while execution it is extracted to temporary directory and next deleted). Suppose a file "TestScript.vbs" was created. The procedure of conversion to 'exe':

1. from commandline run "iexpress" (no quotes, IExpress is windows packing wizard)
2. "Welcome to IExpress 2.0": choose 'Create new Self Extraction Directive file', >Next,
3. "Package purpose": tick 'extract files and run an installation command', >Next,
4. "Package title": write any, this will not be visible in proceeding as below, >Next,
5. "Confirmation promt": tick "no prompt", >Next,
6. "License agreement": tick "do not display a license", >Next,
7. "Packaged files": add script file ("TestScript.vbs"), >Next,
8. "Install program to launch": write (wscript.exe "chart.vbs") (no brackets), leave <None> for post install command, >Next,
9. "Show window": tick "hidden", >Next,
10. "Finished message": tick "no message", >Next,
11. "Package name and options": choose destination and name for 'exe' file, tick both options (hide extraction and long file names), >Next,
12. "Configure reboot": choose "no reboot", >Next,
13. "Save self exstraction directive": choose save for future editing, >Next,
14. "Create package": >Next, >Finish.

This procedure adds ca 63 kB of own code, but compress the script. The icon can be replaced by existing freeware programs, as 'Iconedit' by David Cornish.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top