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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Input Box when Application is Started 1

Status
Not open for further replies.

DYM03

Technical User
Mar 6, 2003
28
US
What procedure can be used in Excel to automatically open an inputbox or user form? I have tried Workbooks_Open and that is working. When I run my code the message box comes up but I need the message box or form to pop up when the spreadsheet is initially opened.
 
Do you mean that the first time the user opens the workbook it comes up , but then when they go into it afterwards it doesnt ?

if so what i would do is have a hidden sheet, with a namedrange of something like Runonce, then in my code i would have a if statement to look at the value in that cell, if the cell was blank then i would display the message, then have code to write a value to that cell , so when the user reopens the sheet, it wont display because of the if statement,

Filmmaker, gentlemen and proffesional drinker



 
I mean each time the user opens the spreadsheet a box will pop up promting of entry. What type of Add-in are you referring to? I am lost on that one.
 
Private Sub Workbook_Open()
MsgBox "NUNS"
End Sub


That works i dont know why you are having a problem have you got the code in Thisworkbook ? or have you got it in a module

Filmmaker, gentlemen and proffesional drinker



 
I have it in ThisWorkbook but it does not bring up the message box. I also have macros and when the workbook opens it promts to enable macros. Could that have anything to do with it?
 
Right now this is all I am using to test.

Private Sub Workbook_Open()

InputBox ("Testing")

End Sub

 
The inputbox still is not popping up when I open the workbook. I don't know what is missing. I have it under the object (General). Do I need to change that to something else?
 
not sure what you mean by general,

as a walkthrough to set it up from scratch

open up excel goto tools, macro, sercurity and make sure that is low.

then hit Alt + F11 to open up the VBA editor.

double click on ThisWorkbook

copy the below into the window

Private Sub Workbook_Open()

InputBox ("Testing")

End Sub

save and exit ,

open and it should pop up

Filmmaker, gentlemen and proffesional drinker



 
Thanks so much for your help Chance1234. It was driving me crazy. I didn't have the code in ThisWorkbook. It works now! :)
 
Chance1234 - would a gentleman troll for stars ???? Surely the written thank you is worth more than a virtual pink star ??

DYM03 - in case you don't know, the standard way to say thanks in TT is to award a star. This also helps those users who search the archives to select those threads that have helpful or useful information. To award a star, simply click on the "Mark this post as a helpful / expert post" link on the appropriate post

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top