Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Worksheet activation on Opening Workbook

Hi,

I have a workbook with two sheets: Sheet1 and Sheet2. Sheet1 has code
for freezing the window panes on cell L2.
On opening the workbook, I want Sheet1 to be activated and the panes
frozen. To achieve this I have included code for
Worksheets("Sheet1").activate in ThisWorkbooks open event.

When the workbook is opened, the Sheet1 is active sheet. However, the
freeze panes does not work. However, when I click Sheet2, followed by
Sheet1, the freeze panes is activated in Sheet1. How can I ensure that
Sheet1 is activated on opening of the workbook.

Thanks in advance for all the help.

Regards,
Raj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Worksheet activation on Opening Workbook

In addition to activating Sheet1 in the ThisWorkbook module, call the macro
that freezes the panes without relying on the Worksheet_Activate event:

Private Sub Workbook_Open()
Sheets("Sheet1").Activate
' Call the Freeze Panes macro here
End Sub

HTH,
Matthew Pfluger

"Raj" wrote:

Hi,

I have a workbook with two sheets: Sheet1 and Sheet2. Sheet1 has code
for freezing the window panes on cell L2.
On opening the workbook, I want Sheet1 to be activated and the panes
frozen. To achieve this I have included code for
Worksheets("Sheet1").activate in ThisWorkbooks open event.

When the workbook is opened, the Sheet1 is active sheet. However, the
freeze panes does not work. However, when I click Sheet2, followed by
Sheet1, the freeze panes is activated in Sheet1. How can I ensure that
Sheet1 is activated on opening of the workbook.

Thanks in advance for all the help.

Regards,
Raj

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Worksheet activation on Opening Workbook

On Feb 20, 11:31 pm, Matthew Pfluger
wrote:
In addition to activating Sheet1 in the ThisWorkbook module, call the macro
that freezes the panes without relying on the Worksheet_Activate event:

Private Sub Workbook_Open()
Sheets("Sheet1").Activate
' Call the Freeze Panes macro here
End Sub

HTH,
Matthew Pfluger

"Raj" wrote:
Hi,


I have a workbook with two sheets: Sheet1 and Sheet2. Sheet1 has code
for freezing the window panes on cell L2.
On opening the workbook, I want Sheet1 to be activated and the panes
frozen. To achieve this I have included code for
Worksheets("Sheet1").activate in ThisWorkbooks open event.


When the workbook is opened, the Sheet1 is active sheet. However, the
freeze panes does not work. However, when I click Sheet2, followed by
Sheet1, the freeze panes is activated in Sheet1. How can I ensure that
Sheet1 is activated on opening of the workbook.


Thanks in advance for all the help.


Regards,
Raj


Thanks a ton, Mathhew. That solution worked.
But why was worksheet activation(having freeze panes code) on workbook
opening(having worksheet activation code) not enough to trigger freeze
panes? Any pointers,references or discussions on this kind of events
behaviour most welcome.

Regards,
Raj
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
Prevent worksheet from opening in a workbook laurenm Excel Worksheet Functions 5 January 18th 07 05:42 AM
Worksheet Activation from another workbook Ronbo Excel Programming 3 December 28th 05 09:39 PM
Workbook activation code alanford Excel Programming 4 February 20th 05 01:31 AM
Workbook activation issue Petr Excel Programming 1 February 3rd 05 10:58 AM
Detecting workbook activation Jack Wolf Excel Programming 0 July 26th 03 01:10 AM


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

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"