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 12:35:31
 
 
To
07/10/2002 11:30:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00708385
Message ID:
00708413
Views:
8
>- 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?
>
>The other question is the same placed above but applied to tables. When i generating the excel sheet it uses some tables, some problems will comes if two users are using the same procedure (it shows to the other user: The file is in use).
>
>How can i solve this too?


Edgar:

Excel always wants the full path even if the file is in the same (current) directory.
The code you supplied seems OK. Is it possible that the folder does not exist in the target machine? That would happen if your current directory follows the Windows NT Standard convention so it is under My Documents for the current user. This may not be the same in another machine.

Instead of
dirxls = SYS(5) + CURDIR() + "general.xls"
you can also use
dirxls = FULLPATH("general.xls")
As for the tables, make sure you have SET EXCLUSIVE OFF and you open the tables with SHARED

HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform