Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drive letter error
Message
From
10/01/2007 11:17:07
 
 
To
10/01/2007 11:10:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01184226
Message ID:
01184229
Views:
16
>i have the following code
>
>tmpsheet = getobject('','excel.sheet')
>xlapp = tmpsheet.application
>xlapp.visible = .t.
>xlapp.workbooks.open(filename_)
>
>filename_ is '\pinktemp\61332206.xls' gives me an OLE error as File Not Found
>
>but if i give the drive letter 'e:\pinktemp\61332206.xls' then it is works just fine.
>
>my default has been already set as the E drive, so where is it actually looking and how do i make it work without actually specifying the drive letter.

Try storing default drive letter in a variable and building the full path from that?

lcFilename = lcDefDrive + "\pinktemp\61332206.xls"
...
xlapp.workbooks.open( lcFilename)
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform