ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Forms ran as EXE (https://www.excelbanter.com/excel-programming/348993-forms-ran-exe.html)

stindle

Forms ran as EXE
 
Is there a way to convert a form to an EXE?
I have a user form, I want the user to open, without them seeing Excel.
Should I just use open events? When I do, it still asks me if i want to
enable the macros before it even looks at the form.

Also, when the form is closed, if the form is the only workbook open, I want
to use Application.Close, else Workbooks.Close
What is the code to determine how many workbooks are open so I can write the
if statement? I don't want to leave any loose ends in my coding, so I want to
close Excel if my form opened it, but don't want to close it if the user is
has another file open. Might not be needed if I can convert the form to EXE.
but would be nice to know for later.

TIA
Steve

Tom Ogilvy

Forms ran as EXE
 
There is no support in Excel for converting it to an EXE. That said, you
could build your app in VB and compile it to an EXE. The code would then
use OLE Automation to open Excel and display your form. Application.Visible
= False will hide the application while your form can still be visible.

Application.Workbooks.count will give you the count of open workbooks, but
you might want to loop through all the workbooks and see if they are hidden
or not (example, personal.xls), then make your decision on the visible
workbooks.


http://support.microsoft.com/support...aqVBOffice.asp
Frequently Asked Questions about Microsoft Office Automation Using Visual
Basic

http://support.microsoft.com/support...fdevinapps.asp
Programming Office from Within Office

http://support.microsoft.com/?id=219151
Q219151 - HOWTO: Automate Excel 97 and Excel 2000 from Visual Basic

http://support.microsoft.com/support...automation.asp
Using Automation with Microsoft Excel 97
--
Regards,
Tom Ogilvy

"stindle" wrote in message
...
Is there a way to convert a form to an EXE?
I have a user form, I want the user to open, without them seeing Excel.
Should I just use open events? When I do, it still asks me if i want to
enable the macros before it even looks at the form.

Also, when the form is closed, if the form is the only workbook open, I

want
to use Application.Close, else Workbooks.Close
What is the code to determine how many workbooks are open so I can write

the
if statement? I don't want to leave any loose ends in my coding, so I want

to
close Excel if my form opened it, but don't want to close it if the user

is
has another file open. Might not be needed if I can convert the form to

EXE.
but would be nice to know for later.

TIA
Steve





All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com