Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Problem with using the ActiveWindow property - sometimes

Hello,

I have a VB6 SP5 application with some code which copies page breaks from
one sheet to another, and the first time I run it it works fine.
If I try to run it again without closing and reopening the app I get a
runtime error from this code:

Application.ScreenUpdating = False
If (ActiveWindow.View = xlNormalView) Then
ActiveWindow.View = xlPageBreakPreview
blResetView = True
End If

The message is that the "Object variable or With block variable not set" for
'ActiveWindow.View'.
I have tried using the fully qualified reference
'Excel.Application.ActiveWindow.View' and I still get the same error.

There is a reference set to the Excel 9 object library.

I have tried this on Windows XP Pro and Windows 2000 Pro machines with the
same result.

Any help on this would be appreciated.

Ragnar


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Problem with using the ActiveWindow property - sometimes

I found the cause of the problem, it was the old problem with
Application.Quit not closing Excel.
Still don't know how to get that to work though, so if anyone has found a
way that works reliably I would appreciate hearing about it.

Ragnar


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
Problem using filter property ub Excel Worksheet Functions 8 October 17th 07 09:32 PM
ActiveWindow.SelectedSheets.PrintPreview HelpMe Excel Programming 0 November 17th 04 03:53 PM
problem with resize property Michelle Excel Programming 4 February 23rd 04 02:11 PM
Using ActiveWindow.PointsToScreenPixelsY Pancho Excel Programming 5 February 7th 04 11:23 PM
Problem with PrintArea property Ugleeduck Excel Programming 1 December 5th 03 05:26 PM


All times are GMT +1. The time now is 12:23 PM.

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"