PC Review


Reply
Thread Tools Rate Thread

Bug in Excel 2007? Activewindow

 
 
New Member
Join Date: Jul 2012
Posts: 1
 
      2nd Jul 2012
Hi
Anybody else having this problem?
In VBA using the Activewindow prevents Excel closing in Taskmanager.
When I rem out the Activewindow command, Excel shuts down properly.

Code:
Sub tester()
Dim objExcel As Excel.Application
Dim xlWB As Excel.Workbook
Set objExcel = New Excel.Application
Set xlWB = objExcel.Workbooks.Add
objExcel.Application.DisplayAlerts = False
xlWB.Sheets(1).Name = "MySheet"
'ActiveWindow.FreezePanes = True  'If this line is made active, Excel does not shut down
xlWB.SaveAs FileName:="C:\Users\elliotgr\Downloads\Temp\MyWorkbook.xlsx", _
FileFormat:=xlDefault, Password:="", WriteResPassword:="", _
        ReadOnlyRecommended:=False, CreateBackup:=False
xlWB.Close
Set xlWB = Nothing
objExcel.Application.DisplayAlerts = True
objExcel.Quit
Set objExcel = Nothing
End Sub
Using Windows 7 and Excel 2007
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 SP1 - Crash (needing reboot) on "ActiveWindow.Close" Ron West Microsoft Excel Crashes 4 17th Jan 2009 04:54 PM
excel 2007 problem, activewindow.visible = false does not work bmurphy@xlrotor.com Microsoft Excel Programming 1 1st May 2007 09:20 AM
Excel.ActiveWindow Is Excel.ActiveWindow Returns False Neal Andrews Microsoft Excel Programming 1 26th Oct 2006 11:10 AM
Using ActiveWindow from an ASP script or website =?Utf-8?B?RGViIFBsb3M=?= Microsoft Word Document Management 0 18th Jun 2004 09:19 PM
Using ActiveWindow from an ASP script/website =?Utf-8?B?RGViIFBsb3M=?= Microsoft Word Document Management 0 18th Jun 2004 09:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:32 AM.