Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Object variable error

Hi,

I have an Excel workbook that works fine when opening in an Excel window.
This workbook needs to sit on our intranet though. When opening it opens in
an Internet Explorer Window. The file works ok except that the following
code which is attached to a button on a form:

Private Sub FelipeButton32_Click()
ActiveSheet.PageSetup.PrintArea = "$AA$13:$Ad$16"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, collate:=True
ActiveSheet.PageSetup.PrintArea = "$B$2:$k$175"
End Sub

Causes:
Run-Time error '91' - Object variable or With block variable not set.

Yet the routine doesn't cause the problem when opened in Excel normally.
Can anyone tell me why at all?

Thanks

Andy

Reply
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
Runtime Error 91 Object variable or With block variable not set. Tim Excel Programming 9 June 5th 08 10:03 PM
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
Getting inconsistent Error 91-Object variable or With block variable not set mfq Excel Programming 0 December 14th 05 06:08 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 05:40 AM.

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

About Us

"It's about Microsoft Excel"