Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid path or filename
Message
From
08/07/2012 06:59:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
08/07/2012 05:48:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01547814
Message ID:
01547815
Views:
49
>hi all,
>
>i use to this code at office 2003 it works , i try it with office 2007. error message
>invalid path or filename
>
>SET DEFAULT TO C:\dept
>a=str(YEAR(DATE()))+"_"+TRANSFORM(MONTH(DATE())-1)
>SET DEFAULT TO C:\dept\&a
>gcDelimName = ALIAS( ) + '.xlsx'
>gcDelimfile = forcepath(m.gcDelimName,'c:\dept\&a')
>IF !EMPTY(m.gcDelimFile)  
>  COPY TO (m.gcDelimFile) type xls& i try xlsx,xl5,and csv
>ENDIF
>
>
>thanks

Your variable a contains " 2012_6" (with six spaces), because str() without extra parameters. First off, you should
a=TRANSFORM(dtos(DATE()-1), "@R 9999_99")
and the Set default to then sees, after macro is expanded,
set default to c:\dept\      2012_7
and then stops parsing at the first space, then doesn't know what to do with the 2012_7 and gives you the error.
Second, in some cases you may want to have spaces or other characters in your path name - then use the name expression.
lcPath="c:\dept\"+a
set default to (lcPath)
That would have worked even if your path contained spaces, provided that the path exists.

back to same old

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

Click here to load this message in the networking platform