![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Save and Close Excel Topic Summary: Created On: 24-Feb-2006 22:44 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Tony, That didn't quite do the job, but it set me in the right direction. Here's what I found: This line had no affect. When the script got to the "Close" statement, Excel asked if I wanted to save the changes. oleMethod(activeSheet, "SaveAs", autoArgs) I changed it to oleMethod(activeWorkbook, "SaveAs", autoArgs) Now Excel says this file exists, do I want to replace. I further changed it to oleMethod(activeWorkbook, "Save") Now it works as expected. Carl | |
![]() |
|
I've opened and modified an Excel spreadsheet from a dxl script using oleMethods, etc. How do I save it and exit Excel?
Edited: 24-Feb-2006 at 23:33 by Carl Mattoon |
|
![]() |
|
![]() |
|
Something like this should do it.
You will need to add some error checking etc etc... OleAutoArgs autoArgs = null autoArgs = create clear(autoArgs) put(autoArgs, "Your File Name") oleMethod(activeSheet, "SaveAs", autoArgs) // get a handle on the active workbook oleGet(excelApplication, "ActiveWorkbook", activeWorkbook) oleMethod(activeWorkbook, "Close") // Quit Excel oleMethod(excelApplication, "Quit") ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Tony,
That didn't quite do the job, but it set me in the right direction. Here's what I found: This line had no affect. When the script got to the "Close" statement, Excel asked if I wanted to save the changes. oleMethod(activeSheet, "SaveAs", autoArgs) I changed it to oleMethod(activeWorkbook, "SaveAs", autoArgs) Now Excel says this file exists, do I want to replace. I further changed it to oleMethod(activeWorkbook, "Save") Now it works as expected. Carl |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Save and Close Excel
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.