Happy New Year to you all!
I get Runtime error '1004': "Unable to set the PrintArea property of the
PageSetup class" at the line below starting with "Sheet1.PageSetup.PrintArea
=" as noted by "error" below.
Do any of you see any obvious error I done with the code? Could it be caused
by not having the right window active?
Here is the extract from the code:
....
With Application.CommandBars.FindControl(id:=182)
If .State = msoButtonDown Then .Execute
End With
Application.ThisWorkbook.Windows(ThisWorkbook.Name).View =
xlPageBreakPreview '
Sheet1.PageSetup.PrintArea =
Sheet1.Range("A1:O1450").SpecialCells(xlCellTypeVisible).Address '
< ---_H_E_R_E_
....
The code is initated by a button event in an UserForm procedure 'Sub
CommandButton1_Click' and after several code procedures this happen in the
end. All I want is to hide rows and show others in sheet1(codename).
At first I thougt it was caused by to many signs (>256), but it was just
this address: $A$1:$O$369,$A$514:$O$801,$A$946:$O$1231,$A$1375:$O$1450
Any comments?
/Regards
Bookmarks