![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Excel Save Topic Summary: Created On: 19-Oct-2007 07:36 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
ffice I am trying to save the excel file using the Automation commands void savefileExcel(string filename) { clear(args) put(args, "FileName", filename) oleMethod(objWorkbook, "SaveAs", args) } In the above script if the excel file already exists It shall prompt me a message A filename already exists do you want to replace it...... When I press ok it shall replace it as I mentioned the property name as "SaveAs" But If I click no it shall save as book1 or book2 or so on..... Is there any command which make me to get the name of the filename with which excel sheet has been saved.... I had tried with the following commands but in vain... oleGet("FileName",args,filename2) oleGet("ObjExcel","FileName",args,filename2) oleGet("ObjExcel","FileName",filename2) when I print the contents of filename2 it displays nothing.... I had tried with the above commands but could not work could any one suggest me how to get the name of the file with which the excel has been saved and if the excel has not been saved is there any way which makes the excel to be closed only if the user saves it . |
|
![]() |
|
![]() |
|
Subrojyoti,
The name is not a property of the Excel object. The name is a property of the Workbook object. string sName oleGet(objWorkbook, "Name", sName) should give you what you want. You can also try the fullName property, but you'll need to escabe any \ characters in order to use it. i.e, c:\temp\file.xls becomes c:\\temp\\file.xls Good luck. ------------------------- Kevin Murphy http://www.baselinesinc.com The Requirements Management Experts |
|
![]() |
|
![]() |
|
If you opened a workbook in Excel, modified it, and want to save, don't do SaveAs. Just use "Save". This will save the file as it is currently named.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Hi kevin and David thank you for your suggestion... |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Excel Save
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.