Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default freeze panes from vba

This works in a macro inside Excel

Range("G2").Select
ActiveWindow.FreezePanes = True

It does exactly what I'd expect. It puts a horizontal freeze line between
row 1 and row 2 and a vertical freeze line between column F and column G.

But I need to use from MS Access vba code so I'm doing this:

objExcelSht.Range("G2").Select
objExcelApp.ActiveWindow.FreezePanes = True

It does freeze but not the same way. It only puts in a vertical freeze line
between columns F and G. There is no horizontal freeze line.

What do I hvae to do from vba in Access to get the same results?

Thanks,

Keith


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default freeze panes from vba

Well this is odd. It works fine if I dont' make the thing visible until
after the entire process is complete. So I guess I'm okay. But I think it
should work even if it's visible while being created so input would be
appreciated anyway.


"Keith G Hicks" wrote in message
...
This works in a macro inside Excel

Range("G2").Select
ActiveWindow.FreezePanes = True

It does exactly what I'd expect. It puts a horizontal freeze line between
row 1 and row 2 and a vertical freeze line between column F and column G.

But I need to use from MS Access vba code so I'm doing this:

objExcelSht.Range("G2").Select
objExcelApp.ActiveWindow.FreezePanes = True

It does freeze but not the same way. It only puts in a vertical freeze
line between columns F and G. There is no horizontal freeze line.

What do I hvae to do from vba in Access to get the same results?

Thanks,

Keith




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default freeze panes from vba

I've always selected the sheet first
removed the freeze panes
selected A1 to make sure it's visible
select the cell that I really want to use
and reapply the freeze panes.

Dim wks As Worksheet
Set wks = Worksheets("Sheet1")
With wks
.Parent.Activate 'correct workbook
.Select 'correct sheet
ActiveWindow.FreezePanes = False
.Range("A1").Select
.Range("G2").Select
ActiveWindow.FreezePanes = True
End With

(this is from within excel.)

Keith G Hicks wrote:

This works in a macro inside Excel

Range("G2").Select
ActiveWindow.FreezePanes = True

It does exactly what I'd expect. It puts a horizontal freeze line between
row 1 and row 2 and a vertical freeze line between column F and column G.

But I need to use from MS Access vba code so I'm doing this:

objExcelSht.Range("G2").Select
objExcelApp.ActiveWindow.FreezePanes = True

It does freeze but not the same way. It only puts in a vertical freeze line
between columns F and G. There is no horizontal freeze line.

What do I hvae to do from vba in Access to get the same results?

Thanks,

Keith


--

Dave Peterson
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
Excel 2003 freeze panes won't freeze top row only macbone2002 Excel Discussion (Misc queries) 3 April 22nd 23 02:07 AM
Freeze 2 Panes jordanpcpre Excel Discussion (Misc queries) 6 April 16th 09 08:36 PM
Freeze Panes sjm cpa Excel Worksheet Functions 8 September 13th 08 02:00 AM
Freeze Panes peter.thompson[_68_] Excel Programming 2 January 31st 06 05:40 AM
Freeze Panes rexmann Excel Discussion (Misc queries) 4 June 9th 05 03:00 PM


All times are GMT +1. The time now is 02:25 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"