ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application Event - Opening Workbook (https://www.excelbanter.com/excel-programming/320695-application-event-opening-workbook.html)

Tim Childs

Application Event - Opening Workbook
 
Hi

I have for a long time been making good use of a utility file based on
Chip P's example of an Excel workbook that tracks Excel files being
opened and then undertakes certain activities for specific files.

After what I thought was just another routine editing session, I found
an error when starting the Excel session the following day. The VBE
was opened in step mode in the utility file at this point:

Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook)

The utility is opened automatically by Excel from an alternate xlstart
directory

The file opens fine when taken out of the alternate xlstart directory
and opened manually.

Has anyone else had this or a similar problem?

Up to now I have rectified it by going back to an earlier copy and
trying to re-input the edits

Thanks

Tim

gocush[_29_]

Application Event - Opening Workbook
 
I'm using xl2000. The syntax automatically generated by xl in this event is:

Private Sub Workbook_Open()

You might try making a copy of your file with this simplified version and
test it.

"Tim Childs" wrote:

Hi

I have for a long time been making good use of a utility file based on
Chip P's example of an Excel workbook that tracks Excel files being
opened and then undertakes certain activities for specific files.

After what I thought was just another routine editing session, I found
an error when starting the Excel session the following day. The VBE
was opened in step mode in the utility file at this point:

Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook)

The utility is opened automatically by Excel from an alternate xlstart
directory

The file opens fine when taken out of the alternate xlstart directory
and opened manually.

Has anyone else had this or a similar problem?

Up to now I have rectified it by going back to an earlier copy and
trying to re-input the edits

Thanks

Tim


Tim Childs

Application Event - Opening Workbook
 
Hi

I think the event you are referring to is the workbook containing the macro
being opened whereas the application level macro traps ALL workbooks being
opened - because it is at the Excel application level not the workbook
level.

Hope that is not gobbledygook!

Thanks

Tim


"gocush" /delete wrote in message
...
I'm using xl2000. The syntax automatically generated by xl in this event

is:

Private Sub Workbook_Open()

You might try making a copy of your file with this simplified version and
test it.

"Tim Childs" wrote:

Hi

I have for a long time been making good use of a utility file based on
Chip P's example of an Excel workbook that tracks Excel files being
opened and then undertakes certain activities for specific files.

After what I thought was just another routine editing session, I found
an error when starting the Excel session the following day. The VBE
was opened in step mode in the utility file at this point:

Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook)

The utility is opened automatically by Excel from an alternate xlstart
directory

The file opens fine when taken out of the alternate xlstart directory
and opened manually.

Has anyone else had this or a similar problem?

Up to now I have rectified it by going back to an earlier copy and
trying to re-input the edits

Thanks

Tim




gocush[_29_]

Application Event - Opening Workbook
 
Yes, I was just wondering if you triggered the event at the workbook level it
might make some difference.
Okay the event you are using is in a Utility xls and is triggered when it
opens as well as when it opens other xls files. Is it possible, for instance
that of you workbooks might have some code like:
Application.EnableEvents=False
Some other code which crashed
Application.EnableEvents=True

Since Application.EnableEvents does not reset itself, this would
prevent you app_event from firing.
Just a guess....

"Tim Childs" wrote:

Hi

I think the event you are referring to is the workbook containing the macro
being opened whereas the application level macro traps ALL workbooks being
opened - because it is at the Excel application level not the workbook
level.

Hope that is not gobbledygook!

Thanks

Tim


"gocush" /delete wrote in message
...
I'm using xl2000. The syntax automatically generated by xl in this event

is:

Private Sub Workbook_Open()

You might try making a copy of your file with this simplified version and
test it.

"Tim Childs" wrote:

Hi

I have for a long time been making good use of a utility file based on
Chip P's example of an Excel workbook that tracks Excel files being
opened and then undertakes certain activities for specific files.

After what I thought was just another routine editing session, I found
an error when starting the Excel session the following day. The VBE
was opened in step mode in the utility file at this point:

Private Sub App_WorkbookOpen(ByVal Wb As Excel.Workbook)

The utility is opened automatically by Excel from an alternate xlstart
directory

The file opens fine when taken out of the alternate xlstart directory
and opened manually.

Has anyone else had this or a similar problem?

Up to now I have rectified it by going back to an earlier copy and
trying to re-input the edits

Thanks

Tim





Tim Childs

Application Event - Opening Workbook
 
Hi

thanks for that response

as faras I can tell tis is not happening as the procedure is stuck on the
first line as the Excel application is being opened

bw

Tim

"gocush" /delete wrote in message
...
Yes, I was just wondering if you triggered the event at the workbook level

it
might make some difference.
Okay the event you are using is in a Utility xls and is triggered when it
opens as well as when it opens other xls files. Is it possible, for

instance
that of you workbooks might have some code like:
Application.EnableEvents=False
Some other code which crashed
Application.EnableEvents=True

Since Application.EnableEvents does not reset itself, this would
prevent you app_event from firing.
Just a guess....





All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com