![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Modifying Enhanced Excel Report Topic Summary: Created On: 24-Sep-2008 00:38 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|||
Hi,
I've commented out the UI portion from the script (from Galactic Solutions) and run the script so that by default, the OLE objects are exported to Excel. Everything's dandy till now. I've added a function called 'saveFile()' to automatically save the excel file to my desired location. However, it's not saving the file; the 'Do you wish to save the excel file?' dialog appears. Could anyone let me know where the boo-boo is? Thanks.
|
|||
![]() |
|||
![]() |
|||
Look on the web -- there is a parameter that has to be set to either true or false to save while passing the dialog box.
However, my memory can not remember the parameter off the top of my head. |
|||
![]() |
|||
![]() |
|||
Here is my function to save a new file after it has been created.
The file open is just a bool I set to true to know that a file was indeed created. Just look at the important part. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|||
![]() |
|||
![]() |
|||
I tried my saveFile() function and also the one you showed. This is the error message I get:
OLE Method Failed: Problem with OLE Argument names How do I address that? This is the piece of code that is under consideration: clear objArgBlock put(objArgBlock, "FileName", exportDir expName) string tempStr = oleMethod(docHandle, "SaveAs", objArgBlock) |
|||
![]() |
|||
![]() |
|||
Looking at just those 3 lines of code I can't tell you anything. Is your docHandle a workbook? Is your exportDir and expName formatted correctly?
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|||
![]() |
|||
![]() |
|||
Here's a detailed look at the function:
void saveFile (string exportDir, string expName, OleAutoObj docHandle) { expName = expName ".csv" clear objArgBlock put(objArgBlock, "FileName", exportDir expName) string tempStr = oleMethod(docHandle, "SaveAs", objArgBlock) if ( tempStr != null) errorBox("SaveFile Failed!") // close the excel file and then disconnect from excel clear objArgBlock put(objArgBlock, "SaveChanges", false) oleMethod(docHandle, "Close", objArgBlock) } // end saveFile I'm calling the function as: saveFile (OUTPUTLOCATION, name module "", objDoc) where OUTPUTLOCATION is decalred as const string OUTPUTLOCATION = "C:/Documents and Settings/My Documents/" and objDoc is declared as OleAutoObj objDoc = oleCreateAutoObject("Excel.Application") and module is declared are Module module = current Thank You. |
|||
![]() |
|||
![]() |
|||
Thats your problem. You're trying to save Excel, not the Workbook. The OleAutoObj you call the SaveAs function with needs to be a handle to a Workbook. ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|||
![]() |
|||
![]() |
|||
The workbook(s) is used in several functions in the script, as a function parameter. I'm confused by the number of times it is passed to different functions (line 930 onward, in the script).Will making it a global variable will resolve the issue?
|
|||
![]() |
|||
![]() |
|||
There is a Workbooks property and a Workbook. You need the Workbook. Just instead of passing the docHandle variable to saveFile, pass your Workbook handle.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|||
![]() |
|||
![]() |
|||
It is able to generate an excel sheet just as needed. With the excel window frame intact, when I close the sheet and double click the file in windows explorer, it bring up the document it generated. However, when I kill the excel window frame and then double click on the file, on the excel window frame appears, not the excel sheet. And the frame is all garbled at the top; meaning, it doesn't have it usual menu bar or anything.
Edited: 25-Sep-2008 at 21:22 by anant mitra |
|||
![]() |
Telelogic DOORS
» DXL Exchange
»
Modifying Enhanced Excel Report
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.