Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Freezing Header Row

Hello,

I am trying to freeze the first row of an Excel Worksheet using VB. I
have tried many different codes and none of them work, I have been getting
Null Exception Errors. Here is a piece of code that I am trying to use to
freeze the first row.

objxloutsheet = objxloutwbook.ActiveSheet
Dim FP As Excel.Window
objxloutsheet.Range("A1, Z1").Select()
FP.FreezePanes() = True

I am also not sure on how to select the first row in the FP.FreezePanes() =
True line.

Any help would be appreciated, Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Freezing Header Row

Hi
Try this:
Range("A2").Select
ActiveWindow.FreezePanes = True
HTH
John
"mdup" wrote in message
...
Hello,

I am trying to freeze the first row of an Excel Worksheet using VB. I
have tried many different codes and none of them work, I have been getting
Null Exception Errors. Here is a piece of code that I am trying to use to
freeze the first row.

objxloutsheet = objxloutwbook.ActiveSheet
Dim FP As Excel.Window
objxloutsheet.Range("A1, Z1").Select()
FP.FreezePanes() = True

I am also not sure on how to select the first row in the FP.FreezePanes() =
True line.

Any help would be appreciated, Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Freezing Header Row

hi
Activewindow.Freezepanes = True
objxloutsheet.Freezepanes = True should work too.

Regards
FSt1

"mdup" wrote:

Hello,

I am trying to freeze the first row of an Excel Worksheet using VB. I
have tried many different codes and none of them work, I have been getting
Null Exception Errors. Here is a piece of code that I am trying to use to
freeze the first row.

objxloutsheet = objxloutwbook.ActiveSheet
Dim FP As Excel.Window
objxloutsheet.Range("A1, Z1").Select()
FP.FreezePanes() = True

I am also not sure on how to select the first row in the FP.FreezePanes() =
True line.

Any help would be appreciated, Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Freezing Header Row

Thanks for the reply. Freezepanes is not a member of worksheets, I am not
getting this as the error "Public member 'FreezePanes' on type 'Worksheet'
not found." The error occurs when I have the following as the code:

objxloutsheet.FreezePanes = True

"FSt1" wrote:

hi
Activewindow.Freezepanes = True
objxloutsheet.Freezepanes = True should work too.

Regards
FSt1

"mdup" wrote:

Hello,

I am trying to freeze the first row of an Excel Worksheet using VB. I
have tried many different codes and none of them work, I have been getting
Null Exception Errors. Here is a piece of code that I am trying to use to
freeze the first row.

objxloutsheet = objxloutwbook.ActiveSheet
Dim FP As Excel.Window
objxloutsheet.Range("A1, Z1").Select()
FP.FreezePanes() = True

I am also not sure on how to select the first row in the FP.FreezePanes() =
True line.

Any help would be appreciated, Thanks in advance.

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
find header then replace header with number of entries below heade kjotro Excel Programming 5 February 12th 10 10:59 PM
Omit header from first page without embedding header in code ibvalentine Excel Worksheet Functions 6 August 28th 07 05:10 AM
Excel-Header-My Company Name won't work in Header (AT&T) & Time June K Excel Discussion (Misc queries) 2 April 10th 06 08:36 PM
Sort - Header:=xlGuess vs Header:=xlNo mwc0914[_7_] Excel Programming 1 October 4th 05 05:21 PM
how do I permanetly add custom header to excel header list? GARY Excel Discussion (Misc queries) 1 December 15th 04 08:52 PM


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

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

About Us

"It's about Microsoft Excel"