Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create/Save Excel Spreadsheet from VFP
Message
From
07/12/2001 04:28:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00590887
Message ID:
00591025
Views:
26
>I am trying to CREATE an Excel sheet from VFP using a folder and file name entered by the operator. The idea is that it will launch excel, create the sheet, immediately save it, and leave it on the screen for editing. The operator would save it again on the way out.
>
>The problem is that I get a 'file not found' type error on my 'save as' statement.
>
>m.filename = TRIM(m.filename) + '.xls'
>public oME
>oME=createobject("excel.application")
>with oME
>.application.workbooks.add
>.application.workbooks.saveas.filename(m.filename)
>endwith
>oME = ''

Todd,
You solved it yourself. However if file is not existant and operator chooses quit w/o save you'd have created an empty xls ?
If it exists, then already saved once :
m.filename = TRIM(m.filename) + '.xls'
oME=createobject("excel.application")
with oME
 .workbooks.open(m.filename) && Assumed m.filename had fullpath
 .visible = .t.
endwith
PS: In your solution you don't need .Application since oMe is the application object itself.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform