LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Help - Error: Unable to set the PrintArea property of the PageSetup class

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(xlCellTypeVi sible).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


 
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
VBA error: Unable to set the Values property of the Series class Marco Shaw Charts and Charting in Excel 1 July 12th 05 02:34 PM
Unable to set the PaperSize property of the PageSetup class [email protected] Excel Programming 2 November 22nd 04 03:43 PM
Error: Unable to get the OLEObjects property of the worksheet class Grant Excel Programming 2 August 6th 04 02:20 PM
Unable to Set LeftFooter Property Class PageSetup (ASP) fredlankovich Excel Programming 0 June 23rd 04 07:56 PM
Unable to set the PrintQuality property of the PageSetup class. No Name Excel Programming 1 January 14th 04 04:43 PM


All times are GMT +1. The time now is 01:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"