Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default wrkbook_Open event, Help??

Problems w/ Workbook_Open event
Hi, my events work. Just not the

workbook_open, auto_open, or workbook_activate ones that i'm trying t
use to accomplish a task. Other events work just fine though...such a
workbook_beforeclose()

When I open the workbook nothing happens (other than ii openning).
put some msgbox commands in the workbook_open() but it doesn't ru
them.. Could this be because I have the entire workbook protected (Rea
only). Has anyone experienced this or knows what may be causing it?

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default wrkbook_Open event, Help??

Can we see your code? Please also confirm where the code is located i
your project. - Piku

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default wrkbook_Open event, Help??

Sure. I have the events procedure's in the "ThisWorkbook" portion o
the the VBA project. I'd like to mention that the BeforeClose even
seems to work fine.


Code
-------------------


Private Sub Workbook_Open()

MsgBox "Workbook opening"
' Application.EnableEvents = False

' Application.StatusBar = "Initializing workbook... Please standby"

' Call Worksheets("Sheet1").refreshFooterSheet1 'refresh footer
MsgBox "Workbook opening2"
' Call Worksheets("Sheet1").Sheet1Protection 'redo protection on Unit 1

' Worksheets("Unit 1").Protect password:="password", userinterfaceonly:=True

' Application.StatusBar = False

' Application.EnableEvents = True

End Sub

-------------------


As you can see i've commented out most of the procedure calls as I wa
afraid they may be causing a problem. I left only the MsgBox to attemp
to "see" it. But no dice. ALso, i'm not sure how to test this othe
than closing the workbook and opening it again. (if i just run th
procedure it works fine, but what I want is it to work when th
workbook is open).

The entire workbook is protected with the read-only option. Could thi
have an effect? I don't think calling the procedures in the Sheet
code is a problem (it was an attempt to keep specific code to it
respective sheet) since I have a beforeClose event that works and look
like:


Code
-------------------

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Call Worksheets("Sheet1").removeSheet1ToolBar
Application.EnableEvents = True


End Sub


-------------------


Thank yo

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default wrkbook_Open event, Help??

The Read Only thing should not affect this. The code works fine for me
but I'm looking at your use of Application.EnableEvents and wondering
though it seems to be implemented correctly, if that could be causin
your problems. I'd say you should try running just the statemen
'Application.EnableEvents = True' immediately before you reopen th
workbook. Try that and let me know what happens... - Piku

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default wrkbook_Open event, Help??

Unfortunately, it still does nothing.

Basically, I have this now:


Code
-------------------

Private Sub Workbook_Open()

Application.EnableEvents = True
MsgBox "Workbook opening"
End Sub

-------------------


Hrm, other things I have the code locked so you need a pw to view it..
The sheet itself isn't protected yet, I will do that after but I doub
this has any effect. When I CLOSE the workbook THAT event works fine.

Is there an option somewhere to ensure that EnableEvents is True (
mean before this event is 'executed')?? I couldn't find one myself bu
i read somewhere it is set to TRue by default...

Thank

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default wrkbook_Open event, Help??

It is true by default, but what I'm shooting for is for you to enabl
events from another workbook fefore you open that one. That should b
the last thing you do before opening it. - Piku

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Event Steve Excel Discussion (Misc queries) 2 October 14th 08 11:04 PM
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 PM
Do Event John Gittins Excel Programming 1 October 22nd 03 04:58 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 05:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"