SanomaJean
SanomaJean

Reputation: 181

Compile Error: Method or Data Member Not Found vba

I am trying to automate the cleaning of a worksheet template to create a flat file for database insertion.

Below is my code that's throwing the error. I am trying to unfreeze panes for the worksheet but keep getting the Compile Error: Method or Data Member not found error on that line.

wsPerm is the worksheet I am working on.

'Unhide All Columns
wsPerm.Unprotect Password:="DRP"
wsPerm.Range("A1:FB1").EntireColumn.Hidden = False
wsPerm.FreezePanes = False
wsPerm.Activate
ActiveWindow.FreezePanes = False
wsPerm.Cells.UnMerge

Upvotes: 0

Views: 814

Answers (1)

Gareth
Gareth

Reputation: 5243

The .FreezePanes property only works on the Window object type so in your case, remove

wsPerm.FreezePanes = False

Which leaves:

'Unhide All Columns
wsPerm.Unprotect Password:="DRP"
wsPerm.Range("A1:FB1").EntireColumn.Hidden = False
wsPerm.Activate
ActiveWindow.FreezePanes = False
wsPerm.Cells.UnMerge

Upvotes: 3

Related Questions