?
Solved

Excel crashes when closing a spreadsheet created with a vbscript.

Posted on 2009-12-17
5
Medium Priority
?
560 Views
Last Modified: 2012-06-21
When manually closing a spreadsheet that has just been created via vbscript, excel crashes. If Excel is allowed to 'recover my work', it works fine and I am able to save it. If I just open a spreadsheet that has been created with a script previously, it also works just fine. Its only when the script creates the spreadsheet and I try to exit or save it does it crash.  Has any one seen this?

Below is hardware/software/rights info, the script portion used to create the spreadsheet and below that are error details.

Thanks

David K.
--------------------------------------------------------------------------------------
HARDWARE / SOFTWARE / RIGHTS
Dell optiplex 620 Running XP with SP3.
MS Office Excel 2007 (12.0.6504.5001) SP1
I have Administrator rights on the computer
-----------------------------------------------------------
VBSCRIPT USED TO CREATE SPREADSHEET
Set objExcel = createobject("excel.application")
objExcel.visible = true
objExcel.workbooks.add
-----------------------------------------------------------
ERROR DETAILS
AppName: excel.exe
AppVer: 12.0.6504.5001
ModName: kernel32.dll
ModVer: 5.1.2600.5781
fDebug: 0
offset: 00012afb
0
Comment
Question by:WaywardS0n
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:omgang
ID: 26074048
What happens if you destroy the Excel object variable as soon as the script is done creating the workbook?

Set objExcel = Nothing

OM Gang
0
 

Author Comment

by:WaywardS0n
ID: 26085006
I will try this on Monday. Haven't even considered that angle. Thanks, will provide feedback after testing.
0
 

Author Comment

by:WaywardS0n
ID: 26133644
I tried adding Set objExcel = Nothing to the end of the script. Same result.
0
 
LVL 28

Accepted Solution

by:
omgang earned 2000 total points
ID: 26138352
I cannot duplicate the problem using your script with Excel 2003.  The workbook is created and I can save or save as without issue.  I will try and test with Excel 2007 sometime today.

OM Gang
0
 

Author Closing Comment

by:WaywardS0n
ID: 31671808
While the answer wasn't provided as the problem couldn't be duplicated, points should be awarded for taking the time try...

Thank you

David Kuehne
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question