Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ideas using the sys(5) and curdir() commands
Message
From
07/10/2002 14:48:50
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
07/10/2002 11:30:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00708385
Message ID:
00708475
Views:
10
>Hello i have two problems and i need examples of how to...
>
>- I have in a click method some code that saves an excel sheet in the server, when you run it in the server works fine, but when you try to save it from the client it places a message error, about the path where to save. The same thing shows up when you try to access the file saved.
>this is my code to save:
>
>dirxls=sys(5)+curdir()+"general.xls"
>XLApp.ActiveWorkbook.SaveAs(dirxls)
>
>this is my code to open the file "general.xls"
>
>dirxls = SYS(5) + CURDIR() + "general.xls"
>* Read the test data into an Excel spreadsheet.
>oWorkbook = oExcel.Workbooks.Open( DIRXLS )
>
>How can i solve this?

I'm using Set("Directory") instead of sys(5)+curdir(), because it sometimes, in some earlier versions of fox/windows was performing better on UNC paths. Set("directory") omits the final backslash, but it doesn't matter:

dirXls=ForcePath("general.xls", set("directory"))

I've found ForcePath a more reliable way to add a path to a file, than writing my own code - it will add the backslash, and trim the trailing spaces from the path, which also means less code.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform