H
HC Hamaker
I'm running the following code in Excel 2003 on Windows XP:
Dim calllms As String
calllms = "C:\LEICA\LMSASCII.EXE "
calllms = calllms & lblNewFilename.Caption + ".NA0"
taskid = Shell(calllms)
Most of the time this works, but sometimes I get runtime error 5, Invalid
procedure or function call, when the Shell function is executed. The variable
calllms evaluates to
"C:\LEICA\LMSASCII.EXE C:\DOCUME~1\CHAMAK~1\LOCALS~1 \Temp\tmpa0n.NA0"
with no spaces in the file name. If I copy this string and execute it from
the run command under Start, there are no problems whatsoever. I've tried
ShellExecute as well, as it is also inconsistent. Any ideas about what might
be the problem?
Dim calllms As String
calllms = "C:\LEICA\LMSASCII.EXE "
calllms = calllms & lblNewFilename.Caption + ".NA0"
taskid = Shell(calllms)
Most of the time this works, but sometimes I get runtime error 5, Invalid
procedure or function call, when the Shell function is executed. The variable
calllms evaluates to
"C:\LEICA\LMSASCII.EXE C:\DOCUME~1\CHAMAK~1\LOCALS~1 \Temp\tmpa0n.NA0"
with no spaces in the file name. If I copy this string and execute it from
the run command under Start, there are no problems whatsoever. I've tried
ShellExecute as well, as it is also inconsistent. Any ideas about what might
be the problem?