ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FreezePanes from VBA? (https://www.excelbanter.com/excel-programming/373471-freezepanes-vba.html)

G Lykos

FreezePanes from VBA?
 
Greetings! Not understanding what I'm seeing. I'm creating an Excel
workbook from MS Project VBA, then formatting a worksheet in it and
exporting data to it. I want to freeze the pane, and captured the steps
below in a macro from within Excel, then inserted it into the Project sub.

Problem: when the MS Project sub executes, the Select below executes and
the worksheet responds, and the True line below executes but the worksheet
doesn't respond.

'Freeze
Range("F5").Select
ActiveWindow.FreezePanes = True

Any ideas why this doesn't work?

Thanks,
George



William[_2_]

FreezePanes from VBA?
 
Hi

Try this

ActiveWindow.FreezePanes = False
Range("F5").Select
ActiveWindow.FreezePanes = True
--

Regards

William

XL2003




"G Lykos" wrote in message
...
| Greetings! Not understanding what I'm seeing. I'm creating an Excel
| workbook from MS Project VBA, then formatting a worksheet in it and
| exporting data to it. I want to freeze the pane, and captured the steps
| below in a macro from within Excel, then inserted it into the Project sub.
|
| Problem: when the MS Project sub executes, the Select below executes and
| the worksheet responds, and the True line below executes but the worksheet
| doesn't respond.
|
| 'Freeze
| Range("F5").Select
| ActiveWindow.FreezePanes = True
|
| Any ideas why this doesn't work?
|
| Thanks,
| George
|
|



G Lykos

FreezePanes from VBA?
 
This is Windows XP, Excel, and Project 2003, all updates.


"G Lykos" wrote in message
...
Greetings! Not understanding what I'm seeing. I'm creating an Excel
workbook from MS Project VBA, then formatting a worksheet in it and
exporting data to it. I want to freeze the pane, and captured the steps
below in a macro from within Excel, then inserted it into the Project sub.

Problem: when the MS Project sub executes, the Select below executes and
the worksheet responds, and the True line below executes but the worksheet
doesn't respond.

'Freeze
Range("F5").Select
ActiveWindow.FreezePanes = True

Any ideas why this doesn't work?

Thanks,
George





Mark

FreezePanes question
 
I was just logging in to ask a question about FreezePanes... will just append
it here.

I know that that's the way it's designed and written, etc...

But, logically, is there an explanation that someone can give to me why
FreezPanes is a property of the Window object, and not of the Worksheet
object?

Maybe I'm just missing it.

Thanks.



G Lykos

FreezePanes from VBA?
 
William, thanks for the suggestion, but - didn't help. Any other thoughts?

George


"William" wrote in message
...
Hi

Try this

ActiveWindow.FreezePanes = False
Range("F5").Select
ActiveWindow.FreezePanes = True
--

Regards

William

XL2003




"G Lykos" wrote in message
...
| Greetings! Not understanding what I'm seeing. I'm creating an Excel
| workbook from MS Project VBA, then formatting a worksheet in it and
| exporting data to it. I want to freeze the pane, and captured the steps
| below in a macro from within Excel, then inserted it into the Project

sub.
|
| Problem: when the MS Project sub executes, the Select below executes

and
| the worksheet responds, and the True line below executes but the

worksheet
| doesn't respond.
|
| 'Freeze
| Range("F5").Select
| ActiveWindow.FreezePanes = True
|
| Any ideas why this doesn't work?
|
| Thanks,
| George
|
|





NickHK[_3_]

FreezePanes from VBA?
 
What are you expecting to happen ?
Are the Panes alraedy frozen ?

NickHK

"G Lykos" .gbl...
Greetings! Not understanding what I'm seeing. I'm creating an Excel
workbook from MS Project VBA, then formatting a worksheet in it and
exporting data to it. I want to freeze the pane, and captured the steps
below in a macro from within Excel, then inserted it into the Project sub.

Problem: when the MS Project sub executes, the Select below executes and
the worksheet responds, and the True line below executes but the worksheet
doesn't respond.

'Freeze
Range("F5").Select
ActiveWindow.FreezePanes = True

Any ideas why this doesn't work?

Thanks,
George





NickHK[_3_]

FreezePanes question
 
Mark,
If you make another window (WindowsNew) then arrange them so you see both
simultaneously.
Now freeze the panes somewhere on the active window.
You will see the other window is not affected.
Hence it is not a Worksheet property, but a property of the Window.
As you normally only have a single window/workbook, you tend not to notice
this behaviour.

NickHK

"mark" ...
I was just logging in to ask a question about FreezePanes... will just
append
it here.

I know that that's the way it's designed and written, etc...

But, logically, is there an explanation that someone can give to me why
FreezPanes is a property of the Window object, and not of the Worksheet
object?

Maybe I'm just missing it.

Thanks.





Mark

FreezePanes question
 
I hear what you're saying, but I don't think that's the end of the story.

Think of it this way... if you have one workbook, with 10 sheets, and you
have the FreezePanes set on sheet 2, but not any other...

if you click any sheet but sheet 2, the FreezePanes is false, but if you
click on sheet 2, FreezePanes is true.

All in ONE window.

Hence, it is (or should be) also a property of the worksheet.


"NickHK" wrote:

Mark,
If you make another window (WindowsNew) then arrange them so you see both
simultaneously.
Now freeze the panes somewhere on the active window.
You will see the other window is not affected.
Hence it is not a Worksheet property, but a property of the Window.
As you normally only have a single window/workbook, you tend not to notice
this behaviour.

NickHK

"mark" ...
I was just logging in to ask a question about FreezePanes... will just
append
it here.

I know that that's the way it's designed and written, etc...

But, logically, is there an explanation that someone can give to me why
FreezPanes is a property of the Window object, and not of the Worksheet
object?

Maybe I'm just missing it.

Thanks.






G Lykos

FreezePanes from VBA?
 
Nick, I was expecting that the pane would be frozen, same as if I did the
same thing by hand. However, I step through the execution, and the cell is
selected, per below, but then the VBA freezepanes method has no effect.
This from VBA running in MS Project.

George


"NickHK" wrote in message
...
What are you expecting to happen ?
Are the Panes alraedy frozen ?

NickHK

"G Lykos"

.gbl...
Greetings! Not understanding what I'm seeing. I'm creating an Excel
workbook from MS Project VBA, then formatting a worksheet in it and
exporting data to it. I want to freeze the pane, and captured the steps
below in a macro from within Excel, then inserted it into the Project

sub.

Problem: when the MS Project sub executes, the Select below executes

and
the worksheet responds, and the True line below executes but the

worksheet
doesn't respond.

'Freeze
Range("F5").Select
ActiveWindow.FreezePanes = True

Any ideas why this doesn't work?

Thanks,
George








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

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