Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the active path in EXEC via OLE automation
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00336646
Message ID:
00336789
Views:
30
>Try oleExcel.Application.DefaultFilePath property - Returns or sets the default path that Microsoft Excel uses when it opens files.

Tested more, and really works, I was missing to assing this.

The code that works:

>LOCAL lcorigpath
>1. oleExcel = CREATEOBJECT("Excel.application")
>2. lcorigpath = oleExcel.Application.DefaultFilePath
>3. oleExcel.Application.DefaultFilePath="myfullpath"
>4. RELEASE oleExcel
>5. oleExcel = CREATEOBJECT("Excel.application")
>6. oleExcel.Application.Workbooks.Open("mybook.xls")
>7. oleExcel.Application.DefaultFilePath=lcorigpath
>8. oleExcel.visible = .T.


I explain, at point 4 the changes at Application.DefaultFilePath, are saved, so I must release the object and run it again, as point 7 I go back to the original path.

Anyway I think there must be another property ActivePath? Where can I search more inf regarding this.

Many thanks for the help, problem solved!
Pablo Roca
Clavo Congelados, S.A. (La Coruna - Spain)
Sysop of PortalFox

Join MasFoxPro campaign
http://www.masfoxpro.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform