Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook template that is opened "externally" via code---a
VB-like form opens the workbook and creates a new worksheet. I don't have access to this code, but I do need to add code to the template that is triggered either upon open or creating the new sheet. However, neither of these events will trigger since the book is being opened via external code. Is there anyway to work around this? I cannot modify the VB-like form or the module that is initially opening the book and creating the new worksheet. TIA... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could add you code to an Auto_Open sub in a standard code module.
-- HTH Bob Phillips (remove nothere from the email address if mailing direct) wrote in message oups.com... I have a workbook template that is opened "externally" via code---a VB-like form opens the workbook and creates a new worksheet. I don't have access to this code, but I do need to add code to the template that is triggered either upon open or creating the new sheet. However, neither of these events will trigger since the book is being opened via external code. Is there anyway to work around this? I cannot modify the VB-like form or the module that is initially opening the book and creating the new worksheet. TIA... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob, I've tried adding an auto_open() sub to the workbook_open event,
but it just gets bypassed. If I open the template by double clicking the file, the open event is triggered, but when it's opened through the vb-like form, the open event code is bypassed. I tried the code below, but I can't get it triggered after "opening" the form via form: Sub workbook_open () auto_open() End sub Sub auto_open() '*** hide the scollbars With ActiveWindow .DisplayVerticalScrollBar = False .DisplayHorizontalScrollBar = False End With End sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What if the code is added to the Workbook_Open event in ThisWorkbook module ?
Auto_Open code has to be called specifically if workbook is opened programmically e.g. Set wb = Workbooks.Open "myBook.xls" wb.RunAutoMacros xlAutoOpen Kevin Beckham " wrote: Bob, I've tried adding an auto_open() sub to the workbook_open event, but it just gets bypassed. If I open the template by double clicking the file, the open event is triggered, but when it's opened through the vb-like form, the open event code is bypassed. I tried the code below, but I can't get it triggered after "opening" the form via form: Sub workbook_open () auto_open() End sub Sub auto_open() '*** hide the scollbars With ActiveWindow .DisplayVerticalScrollBar = False .DisplayHorizontalScrollBar = False End With End sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kevin, I guess I'm a bit confused. Here's what I've got thus far:
ThisWorkbook: Private Sub Workbook_Open() ActiveWorkbook.RunAutoMacros xlAutoOpen End Sub Module1: Sub auto_open() MsgBox "event happened" End Sub This does not work when the workbook is opened via the VB-like form, but it does work when you dbl click the template to open. It seems the workbook_open event is being bypassed. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event Procedure not working | Excel Programming | |||
user form-on open event? keydown event? | Excel Programming | |||
before print event not working | Excel Programming | |||
Workbook_Open event not working | Excel Programming |