PDA

View Full Version : hide active window using Auto_open



Jag108
05-23-2007, 07:35 PM
I have the code to do this, but it is not working as i desire it to.

What I think is happening is there is still some opening happening in regards to the to work book, what who knows.

But this seems to un-hide the work book again.

I am not sure if any one else has noticed if you open a work book with multiple modules and you have the VBA editor open all these windows seem to keep open in a very annoying way which seems to happen after the auto_open has run undoing my hide.

I have tried application.wait but this only stop all the back ground activity then un-hides my window again, arrrgghhh!!!!

Any ideas?
:banghead:

lucas
05-23-2007, 09:03 PM
Hi Jag,
I have a few questions that might help someone understand your problem.
What code are you using to hide the workbook?
Why aren't you using workbook_open in thisworkbook module instead of old school auto_open?
why don't you know what is happening...is there code in it that you don't understand?

post the problem workbook....

Hard to tell what is going on with the info provided so far...someone can probably help but I think they will need more from you.

Bob Phillips
05-24-2007, 12:18 AM
Close the VBA window, then run your code.

Jag108
05-24-2007, 01:14 PM
I have tried opening the workbook with the VBA editor closed but still the Workbook I want to hide just flashes then reappears.

I have tried Some variations of routines, here are a couple of examples (all fail with the editor open or closed)

Private Sub Workbook_Open()
ActiveWindow.Visible = False
End Sub

Sub Auto_Open()
Add_Workbook_Menu_And_Items
Application.Wait Now() + TimeSerial(0, 0, 10)
Windows("Star_Plus_Hindi_MKII.xls").Visible = False
End Sub

Although when the VBA editor is closed the open process is much faster but still unsuccessful :-(

Jag108
05-24-2007, 01:17 PM
Another piece of information I use a hyper link in another sheet to open this work book (this is my KB so I do not have to keep hunting for various files) I have also tried opening by double clicking the file in the folder but this still fails as well.

What code are you using to hide the workbook?
See post above

Why aren't you using workbook_open in thisworkbook module instead of old school auto_open?
Also See post above

why don't you know what is happening...is there code in it that you don't understand?
It is how Excel is opening the file that I do not understand, code I can read but when you cant see the code that is affecting the environment then it makes debugging really difficult.

lucas
05-24-2007, 01:56 PM
Another piece of information I use a hyper link in another sheet to open this work book (this is my KB so I do not have to keep hunting for various files) I have also tried opening by double clicking the file in the folder but this still fails as well.


Could have something to do with how your calling it with the hyperlink. Better question is what do you mean by kb. Is it holding code that you want to run on other workbooks and you want it open in the background? Or does it have data that you wish to access?