Userform focus question

viper

Active Member
Joined
Feb 15, 2002
Messages
382
Is there a way that I can have my userform display before the file is opened?

I have a userform that will show the user the information they will be wanting to see. I would like for when the file is opened just the userform displays with the information, I have a button for the user to click if they want to add or view the information and another button that will close the file if the userforms data was all they needed to see.

My boss keeps telling me to just keep the files simple but I like all the extras.

Simple never impressed anyone.

Thanks,
 
Hi all,

I know it's too late, but just an information...�@:D


'This workbook module
Private Sub Workbook_Open()
Application.Visible = False
UserForm1.Show
End Sub

'userform1 module

Private Sub UserForm_Click()
MsgBox "Make Excel Visible"
Unload Me
End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Visible = True
End Sub
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
On 2002-09-25 21:58, Colo wrote:
Hi all,

I know it's too late, but just an information...�@:D


'This workbook module
Private Sub Workbook_Open()
Application.Visible = False
UserForm1.Show
End Sub

'userform1 module

Private Sub UserForm_Click()
MsgBox "Make Excel Visible"
Unload Me
End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Visible = True
End Sub

Colo
I saw the post and was going to suggest the same :)
As this is one of the functions for the Html Addin for Excel2000
 
Upvote 0
Hi Ivan, I didn't know... :biggrin:
I also thought about another method using VBS... :biggrin:
How about this? When double click VBS file, execl will be executed,
but user can't see Excel application it self.<pre>
'VBS FILE
'Save this code as *ExecuteXL.VBS*
'------------------------------------------------------------------
xl_file_full_path="C:Sample.xls" 'Change here to your XL full path
set appXL = CreateObject("Excel.Application")
appXL.Workbooks.open(xl_file_full_path)
set appXL=nothing
'-------------------------------------------------------------------

'XL FILE named *Sample.xls*
'---ThisWorkbook module---------------------------------------------
Private Sub Workbook_Open()
UserForm1.Show
End Sub

'---UserForm1 module--------------------------------------------------
Private Sub UserForm_Click()
Application.Visible = True
End Sub
'----------------------------------------------------------------------</pre>


_________________
HTH

With Regards,
Colo

banner.gif

This message was edited by Colo on 2002-09-25 23:30
 
Upvote 0
On 2002-09-25 22:34, Colo wrote:
Hi Ivan, I didn't know... :biggrin:
I also thought about another method using VBS... :biggrin:
How about this? When double click VBS file, execl will be executed,
but user can't see Excel application it self.

<pre>
'VBS FILE
'Save this code as *ExecuteXL.VBS*
'------------------------------------------------------------------
xl_file_full_path="C:Sample.xls" 'Change here to your XL full path
set appXL = CreateObject("Excel.Application")
with appXL
appXL.Workbooks.open(xl_file_full_path)
End with
set appXL=nothing
'-------------------------------------------------------------------

'XL FILE named *Sample.xls*
'---ThisWorkbook module---------------------------------------------
Private Sub Workbook_Open()
UserForm1.Show
End Sub

'---UserForm1 module--------------------------------------------------
Private Sub UserForm_Click()
Application.Visible = True
End Sub
'----------------------------------------------------------------------
</pre>

Yes, that will do very nicely. :biggrin:
If you place the script file on the Desk Top
then all the user has to do is Double click ont the Icon....user can Also change the Icon so that it appears as an Application other then Excel......

Good one..
 
Upvote 0
Well, you know I am going to have to take this one - too handy to pass up!!

LOL! :eek:
This message was edited by ViperGTS on 2002-09-26 15:45
 
Upvote 0
Colo - Very cool! I am going to use this one. One thing I noticed... you are not prompted with the Enable Macros dialog when opening the Workbook this way as you would be for the same Workbook opened normally.
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top