Freeze Panes loss

W

Walter Briscoe

I apologise that I have not made a reasonable attempt to answer this
question for myself.
<http://groups.google.com/advanced_search?num=100&q=&> used to do a
Google Groups Advanced Search.
It now opens <https://groups.google.com/forum/#!overview>
;(

I use Excel 2003.
I lose Freeze Panes settings in the new object if
1) I create a New Window with Window\New Window.
or
2) I copy the active sheet with Edit\Move or Copy Sheet...

The VBA for Freeze Panes is ActiveWindow.FreezePanes = True.

I don't understand the relationship between the Active Sheet and the
Active Window, nor why I lose the Freeze Panes settings, nor how I could
do such operations without loss.

I would value any light on this subject. ;)
 
G

GS

The FreezePanes feature belongs to the Window object, not the
Worksheet. Copying the worksheet (via VBA) doesn't include any window
settings, thus no frozen panes.

This is not the same as copying via the 'Ply' toolbar menu when you
right-click a sheet tab. This also copies the window settings and so
frozen panes persist in the copy.

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
W

Walter Briscoe

In message <[email protected]> of Thu, 14 Nov 2013 00:49:00 in
microsoft.public.excel.worksheet.functions said:
The FreezePanes feature belongs to the Window object, not the
Worksheet. Copying the worksheet (via VBA) doesn't include any window
settings, thus no frozen panes.

I know FreezePanes is a Window property.
I don't know how the Window Object relates to the Worksheet object.
This is not the same as copying via the 'Ply' toolbar menu when you
right-click a sheet tab. This also copies the window settings and so
frozen panes persist in the copy.

Sheets("foo").Copy Before:=Sheets(1) is an "Edit\Move or Copy Sheet..."

Sheets("foo").Select
Sheets("foo").Copy Before:=Sheets(1)
is the result of clicking on the sheet name and doing "Move or Copy..."
by a right click. As you say, that copies FreezePanes settings.

The same is done by clicking on the sheet name and doing "Edit\Move or
Copy Sheet..."

Clicking the sheet name and doing "Window\New Window" creates a Window
object, to which FreezePanes is not copied. The underlying VBA is
Sheets("foo").Select
ActiveWindow.NewWindow

My usual use of "Window\New Window" ia to put 2 windows on the screen
and clicking one, so I can see 2 sheets in a workbook simultaneously. I
will need to be disciplined, in loading the new window to see another
sheet.

Thank you for the help.
 
G

GS

My usual use of "Window\New Window" ia to put 2 windows on the screen
and clicking one, so I can see 2 sheets in a workbook simultaneously.
I will need to be disciplined, in loading the new window to see
another sheet.

This does not 'copy' the 'active window'. It creates another open
instance (ie: Book1:2) of the workbook that was active when you clicked
the "New Window" menuitem. In this case you need to apply FreezePanes
to the new window instance.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top