>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)
.visible = .t.
endwith
PS: In your solution you don't need .Application since oMe is the application object itself.
Cetin