Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Excel Save
Topic Summary:
Created On: 19-Oct-2007 07:36
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 19-Oct-2007 07:36
User is offline View Users Profile Print this message


Subrojyoti Sengupta

Posts: 52
Joined: 18-Nov-2005

fficeffice" />> >

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 .

Report this to a Moderator Report this to a Moderator
 19-Oct-2007 14:29
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 206
Joined: 15-Jul-2005

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
Report this to a Moderator Report this to a Moderator
 22-Oct-2007 19:03
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 24-Oct-2007 14:06
User is offline View Users Profile Print this message


Subrojyoti Sengupta

Posts: 52
Joined: 18-Nov-2005

Hi kevin and David thank you for your suggestion...

Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.