Hi guys and gals,
as in the topic : On Error run Private Sub Workbook_Open() <-- is this possible?
Thanks for any reply!
Hi guys and gals,
as in the topic : On Error run Private Sub Workbook_Open() <-- is this possible?
Thanks for any reply!
Please click the * below if this helps
Private Sub Workbook_Open() will only execute when you open your workbook. You can achieve this by writing another sub routine like Private Sub MyCode() where you can place the code of workbook_open by copying the code between Private Sub Workbook_Open() and End Sub lines and placing it between the lines Private Sub MyCode() and End Sub. Then you can call Mycode if an error occurs in your another sub routine.
Like this.....
Please Login or Register to view this content.
Regards
sktneer
Treat people the way you want to be treated. Talk to people the way you want to be talked to.
Respect is earned NOT given.
I was afraid so....
Thanks for your feedback!
That's not correct. Workbook_Open is a routine like any other. As it has Private scope you have to use Run to call it but you can't do it in one line as an On Error statement - you would have to have a goto statement and run it from there:
for example.Please Login or Register to view this content.
Having said that, if you want to call the same code from two locations, you should put it into a separate routine and call that from both locations.
Remember what the dormouse said
Feed your head
Hi Rory,
awesome, thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks