PDA

Click to See Complete Forum and Search --> : Is it possible to only open the form?


sand
Jun 27th, 2005, 09:03 PM
Hi,

I would like to know if it is possible to run a form that is in a excel file without having the excel file open up but only the form? Thanx

RobDog888
Jun 27th, 2005, 10:28 PM
Probably just show the userform modeless and move the Excel main window off the screen.
Private Sub Workbook_Open()
UserForm1.Show vbModeless
Application.WindowState = xlNormal
Application.Left = -10000
End Sub

sand
Jun 27th, 2005, 10:41 PM
Thanx. But I have a macro that opens the file before it runs. How do i only run the file in the background, so that the user need not open the file.

RobDog888
Jun 27th, 2005, 11:09 PM
You have a macro that opens the file then the code I posted will run when its opened.
You can not show the userform without opening the Excel workbook too. Thats why my code moves the Excel app off the viewable
part of the screen. ;)

sand
Jun 27th, 2005, 11:50 PM
Does that mean whenever users want to use a form, which makes use of other excel files, they have open up all the files asscoicated with it?

RobDog888
Jun 28th, 2005, 12:00 AM
Whichever xls file contains the UserForm must be opened. If you were running macros in another fille then that wouldnt need to be
explicitly opened. Even with that Excel creates a child process of that workbook so it can reference the functions/methods.

Sounds like your trying to create an Excel Add-In out of one or more workbooks (.xls)?