Freeze Panes from Access

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
1,835
Office Version
  1. 2019
  2. 2016
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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,213,496
Messages
6,113,993
Members
448,539
Latest member
alex78

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