Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Sub Workbook_Open not called when opening spreadsheet

I have a number of spreadsheets with code in the Workbook_Open sub. This
code is not being executed when the spreadsheets are opened. Even when I put
a break point at the beginning of the code, the breakpoint is never
triggered, which leads me to believe that the sub is never being called. The
Workbook_Activate sub has the same problem.

The spreadsheets were created with Excel 2000 and were modified and saved
with Excel 2003. I did not have the problem prior to saving them with Excel
2003. If I create a new spreadsheet in Excel 2003 and copy the worksheets
and VB code into the new spreadsheet, the Workbook_Open sub is called and the
code is executed. However, all the formulas and pivot table references still
point to the original spreadsheet, and it is way too much trouble to try to
change all of these.

Does anyone have any suggestions about how to fix the original spreadsheets
to get around this problem?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Sub Workbook_Open not called when opening spreadsheet

On 9 Sep, 13:16, dhputnam wrote:
I have a number of spreadsheets with code in the Workbook_Open sub. *This
code is not being executed when the spreadsheets are opened. *Even when I put
a break point at the beginning of the code, the breakpoint is never
triggered, which leads me to believe that the sub is never being called. *The
Workbook_Activate sub has the same problem.

The spreadsheets were created with Excel 2000 and were modified and saved
with Excel 2003. *I did not have the problem prior to saving them with Excel
2003. *If I create a new spreadsheet in Excel 2003 and copy the worksheets
and VB code into the new spreadsheet, the Workbook_Open sub is called and the
code is executed. *However, all the formulas and pivot table references still
point to the original spreadsheet, and it is way too much trouble to try to
change all of these.

Does anyone have any suggestions about how to fix the original spreadsheets
to get around this problem?

Thanks.


Have you tried the activate event?

D.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Sub Workbook_Open not called when opening spreadsheet

There is no reason that event code that worked fine in Excel 2000 should not
run in 2003. I'd be happy to look at this problem workbook if you wanted to
send it. Even a version with all the sheets cleared of entries to protect
sensitive data, since the only thing that matters is the event code.

and it is way too much trouble to try to change all of these.


Well, it really shouldn't be if you don't have a huge number of linked
workbooks. Use Edit, Links, point to each link, and use Change Source to
change the link from the old workbook to the current one.

--
Jim
"dhputnam" wrote in message
...
|I have a number of spreadsheets with code in the Workbook_Open sub. This
| code is not being executed when the spreadsheets are opened. Even when I
put
| a break point at the beginning of the code, the breakpoint is never
| triggered, which leads me to believe that the sub is never being called.
The
| Workbook_Activate sub has the same problem.
|
| The spreadsheets were created with Excel 2000 and were modified and saved
| with Excel 2003. I did not have the problem prior to saving them with
Excel
| 2003. If I create a new spreadsheet in Excel 2003 and copy the worksheets
| and VB code into the new spreadsheet, the Workbook_Open sub is called and
the
| code is executed. However, all the formulas and pivot table references
still
| point to the original spreadsheet, and it is way too much trouble to try
to
| change all of these.
|
| Does anyone have any suggestions about how to fix the original
spreadsheets
| to get around this problem?
|
| Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Sub Workbook_Open not called when opening spreadsheet

Thanks, Jim. I will send you a copy of the spreadsheet with some further
explanation.

Don

"Jim Rech" wrote:

There is no reason that event code that worked fine in Excel 2000 should not
run in 2003. I'd be happy to look at this problem workbook if you wanted to
send it. Even a version with all the sheets cleared of entries to protect
sensitive data, since the only thing that matters is the event code.

and it is way too much trouble to try to change all of these.


Well, it really shouldn't be if you don't have a huge number of linked
workbooks. Use Edit, Links, point to each link, and use Change Source to
change the link from the old workbook to the current one.

--
Jim
"dhputnam" wrote in message
...
|I have a number of spreadsheets with code in the Workbook_Open sub. This
| code is not being executed when the spreadsheets are opened. Even when I
put
| a break point at the beginning of the code, the breakpoint is never
| triggered, which leads me to believe that the sub is never being called.
The
| Workbook_Activate sub has the same problem.
|
| The spreadsheets were created with Excel 2000 and were modified and saved
| with Excel 2003. I did not have the problem prior to saving them with
Excel
| 2003. If I create a new spreadsheet in Excel 2003 and copy the worksheets
| and VB code into the new spreadsheet, the Workbook_Open sub is called and
the
| code is executed. However, all the formulas and pivot table references
still
| point to the original spreadsheet, and it is way too much trouble to try
to
| change all of these.
|
| Does anyone have any suggestions about how to fix the original
spreadsheets
| to get around this problem?
|
| Thanks.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Sub Workbook_Open not called when opening spreadsheet

Duncan,

Thanks for the suggestion. I do know that the Workbook_Activate sub is not
being called on the open, but I have not tried to trigger the activate event
programmatically. I have a shortcut that calls the same macro that is called
by the Workbook_Open sub, so I have a manual way to proceed, but the
spreadsheet is supposed to automatically call the macro to refresh the data
in the spreadsheet.

Don

"Duncan" wrote:

On 9 Sep, 13:16, dhputnam wrote:
I have a number of spreadsheets with code in the Workbook_Open sub. This
code is not being executed when the spreadsheets are opened. Even when I put
a break point at the beginning of the code, the breakpoint is never
triggered, which leads me to believe that the sub is never being called. The
Workbook_Activate sub has the same problem.

The spreadsheets were created with Excel 2000 and were modified and saved
with Excel 2003. I did not have the problem prior to saving them with Excel
2003. If I create a new spreadsheet in Excel 2003 and copy the worksheets
and VB code into the new spreadsheet, the Workbook_Open sub is called and the
code is executed. However, all the formulas and pivot table references still
point to the original spreadsheet, and it is way too much trouble to try to
change all of these.

Does anyone have any suggestions about how to fix the original spreadsheets
to get around this problem?

Thanks.


Have you tried the activate event?

D.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Sub Workbook_Open not called when opening spreadsheet

Got your workbook, Don, and as I said in my email, the open code did run for
me. Life is strange, Excel stranger<g.

--
Jim
"dhputnam" wrote in message
...
| Thanks, Jim. I will send you a copy of the spreadsheet with some further
| explanation.
|
| Don
|
| "Jim Rech" wrote:
|
| There is no reason that event code that worked fine in Excel 2000 should
not
| run in 2003. I'd be happy to look at this problem workbook if you
wanted to
| send it. Even a version with all the sheets cleared of entries to
protect
| sensitive data, since the only thing that matters is the event code.
|
| and it is way too much trouble to try to change all of these.
|
| Well, it really shouldn't be if you don't have a huge number of linked
| workbooks. Use Edit, Links, point to each link, and use Change Source
to
| change the link from the old workbook to the current one.
|
| --
| Jim
| "dhputnam" wrote in message
| ...
| |I have a number of spreadsheets with code in the Workbook_Open sub.
This
| | code is not being executed when the spreadsheets are opened. Even
when I
| put
| | a break point at the beginning of the code, the breakpoint is never
| | triggered, which leads me to believe that the sub is never being
called.
| The
| | Workbook_Activate sub has the same problem.
| |
| | The spreadsheets were created with Excel 2000 and were modified and
saved
| | with Excel 2003. I did not have the problem prior to saving them with
| Excel
| | 2003. If I create a new spreadsheet in Excel 2003 and copy the
worksheets
| | and VB code into the new spreadsheet, the Workbook_Open sub is called
and
| the
| | code is executed. However, all the formulas and pivot table
references
| still
| | point to the original spreadsheet, and it is way too much trouble to
try
| to
| | change all of these.
| |
| | Does anyone have any suggestions about how to fix the original
| spreadsheets
| | to get around this problem?
| |
| | Thanks.
|
|

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Sub Workbook_Open not called when opening spreadsheet

Thanks for your help. It turned out that having the Analysis Toolpack and
the Analysis Toolpack - VBA add-ins installed was causing the Workbook_Open
not to be called. I manually uninstalled these add-ins and modified the
spreadsheet to programmatically install them on the open and uninstall them
on the close.

"Jim Rech" wrote:

Got your workbook, Don, and as I said in my email, the open code did run for
me. Life is strange, Excel stranger<g.

--
Jim
"dhputnam" wrote in message
...
| Thanks, Jim. I will send you a copy of the spreadsheet with some further
| explanation.
|
| Don
|
| "Jim Rech" wrote:
|
| There is no reason that event code that worked fine in Excel 2000 should
not
| run in 2003. I'd be happy to look at this problem workbook if you
wanted to
| send it. Even a version with all the sheets cleared of entries to
protect
| sensitive data, since the only thing that matters is the event code.
|
| and it is way too much trouble to try to change all of these.
|
| Well, it really shouldn't be if you don't have a huge number of linked
| workbooks. Use Edit, Links, point to each link, and use Change Source
to
| change the link from the old workbook to the current one.
|
| --
| Jim
| "dhputnam" wrote in message
| ...
| |I have a number of spreadsheets with code in the Workbook_Open sub.
This
| | code is not being executed when the spreadsheets are opened. Even
when I
| put
| | a break point at the beginning of the code, the breakpoint is never
| | triggered, which leads me to believe that the sub is never being
called.
| The
| | Workbook_Activate sub has the same problem.
| |
| | The spreadsheets were created with Excel 2000 and were modified and
saved
| | with Excel 2003. I did not have the problem prior to saving them with
| Excel
| | 2003. If I create a new spreadsheet in Excel 2003 and copy the
worksheets
| | and VB code into the new spreadsheet, the Workbook_Open sub is called
and
| the
| | code is executed. However, all the formulas and pivot table
references
| still
| | point to the original spreadsheet, and it is way too much trouble to
try
| to
| | change all of these.
| |
| | Does anyone have any suggestions about how to fix the original
| spreadsheets
| | to get around this problem?
| |
| | Thanks.
|
|


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
Workbook_Open Sub not called when spreadsheet is opened dhputnam Excel Programming 1 September 4th 08 01:37 PM
RTD methods in excel called before workbook_open event [email protected] Excel Programming 0 April 30th 08 03:44 PM
workbook_open not being called when I open the excel file Hany Excel Programming 3 April 8th 06 01:34 PM
Run Workbook_Open only if called Jarek[_14_] Excel Programming 0 September 18th 04 10:05 AM
Run Workbook_Open only if called Jarek[_13_] Excel Programming 1 September 17th 04 03:10 PM


All times are GMT +1. The time now is 10:25 PM.

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

About Us

"It's about Microsoft Excel"