Yes, I understand and use that with great regularity (though the final '\' is omitted). When I add the "final '\' by concatenation" if fails when "passed" to a WizoScript code set. You keep telling me this should work, but I have yet to find a way to make that happen -- which is why I need the "Idiot's Guide" version.In Windows Explorer if you click in the box where the folder name is shown, e.g. "Foo > Bar > Baz" it will change into a regular path, e.g. "C:\foo\bar\baz" that you can copy with Ctrl-C and then paste into a spreadsheet cell with Ctrl-V.
When I add the "final '\' by concatenation" if fails when "passed" to a WizoScript code set. You keep telling me this should work, but I have yet to find a way to make that happen -- which is why I need the "Idiot's Guide" version.
As per my original post, get the script to validate the path entered in your excel sheet. i.e. Add missing trailing '\' and if they are single '\', replace them with "\\" BEFORE passing them to the load function! If you write scripts that don't validate data in ... I'm afraid you'll get crap out or the script will fail (as you are finding!)Andy -- My question is, "What am I doing wrong?" If I have the path (say) "J:\Lews_Data\Designs\Alibre_Standards\O-Ring Basis\" in cell (say) "$'System Values'.$B$5" and I load it (and a File Name) into a WizoScript, it hangs and fails every time. But, if I change the path to "J:\\Lews_Data\\Designs\\Alibre_Standards\\O-Ring Basis\\" it works every time.
If I have the path (say) "J:\Lews_Data\Designs\Alibre_Standards\O-Ring Basis\" in cell (say) "$'System Values'.$B$5" and I load it (and a File Name) into a WizoScript, it hangs and fails every time. But, if I change the path to "J:\\Lews_Data\\Designs\\Alibre_Standards\\O-Ring Basis\\" it works every time.
FPath = NameSht['B3'].value + r'\'
FPath = NameSht['B3'].value
if FPath.endswith(r'\') == FALSE:
FPath = FPath + r'\'
// first convert any double slashes in the file path to singles
FPath = string.replace(FPath , "\\\\", "\\")
// at this point, all slashes in the file path should just be singles. So, now convert them all to doubles
FPath = string.replace(FPath , "\\", "\\\\")
// use the validated FPath in your code
...
And, quite a while ago, I asked you if there was a "close" command for spreadsheets. Your answer (with respect to WizoScript) was "No." Has this changed? When I started coding, it was exceptionally "poor form" to open a file and not close it. Irrational minds want to know...If your problem is because of reading cell contents vs formulas then in your script you could open the spreadsheet twice, the first time to read one type of value, close it, then reopen to read the other type. The user running the script won't know or care you are doing this.