tags:

views:

1470

answers:

4

Is it possible to save a form in VBA as .exe file and then run it.

A: 

No. VBA is an addon to applications to support "scripting" in the form of VB. So unless your application supports a way to save the internal script as en external EXE, you are out of luck.

Wolf5
+2  A: 

I think there is at least 2 way

move the code into visual basic 6 and compile it or use visual studio tool for office and see what you can do.

if these 2 solutions is a no no for you, then you are out of luck

Fredou
+1  A: 

No, not natively.

There are some ways to emulate an EXE:

  • Excel: 3rd party tool that claims to be able to compile an workbook to an EXE: DoneEx XCell Compiler. You can also create an automatic marco, Auto_Open, to run when the workbook is opened.
  • Access: Microsoft used to have a way of delivering an Access database as an executable (the name of the tool escapes me) so you could deploy your database to desktops that didn't have Access installed, but I don't think they offer this anymore. You could convert you MDB to an MDE and set the startup properties to hide the database window and menus and such to emulate an EXE, but your users will need to have Access installed.
  • Word: You can pass the /m switch to Word on startup with the name of a macro to run.
Patrick Cuff
A: 

Hi,

I think DoneEx still needs Excel installed, it just bootstraps something to the xls file, or bootstraps that to something and wraps it up as an exe???/..

as I think this does. http://cpap.com.br/orlando/XLtoExeMore.asp

But at least the second one if free!

I have not tested on PC's with out office.

what is it you are trying to accomplish there may be a work around another way?

thanks Ross

Ross