Freeze Panes from Access

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,110
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
I'm building a Excel Workbook from Access after setting a new Excel.Application.

Set ws= objExcelApp.Workbooks.Open(Myfile).Sheets(1)

With this I am able to use methods ws.cells, ws.columns etc.

I would like to freeze the top row of sheets(1) but haven't been able to figure it out.
In Excel this would be
Code:
Range("A2").Select
ActiveWindow.FreezePanes= true

I am able to select the range of my Excel object, but would need some other way to FreezePanes.
Does anyone know if this is possible ?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Have you tried using objExcelApp?
Code:
objExcelApp.ActiveWindow.FreezePanes = True

PS You should probably use objExcelApp to select the cell and include worksheet/workbook references.
 
Upvote 0
Many thanks Norie that did it nicely. Not sure if I'm using objExcelApp as you suggest. I have
Code:
 Set objExcelApp = CreateObject("Excel.Application")
 Set wb = objExcelApp.Workbooks.Open(Fullpath & Me.Code & ".xlsx")
 Set ws = wb.Sheets(1)
 With ws
...
 
Upvote 0

Forum statistics

Threads
1,224,943
Messages
6,181,917
Members
453,071
Latest member
Gizmo2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top