ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   fileopen (https://www.excelbanter.com/excel-programming/317517-fileopen.html)

A-DESIGN

fileopen
 
Hi,
Can anyone please tell me why this code is working:

fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "c:\04987.ecw", 4)

and this code is not:

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "directory", 4)

They both open the application, the first one open the file also, but the
second one doesn't.

Thanks,
Afshin



JulieD

fileopen
 
Hi at a quick glance try the following,

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & directory , 4)


by placing "" around directory you made it a string rather than a variable

Cheers
JulieD

"A-Design" wrote in message
...
Hi,
Can anyone please tell me why this code is working:

fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "c:\04987.ecw", 4)

and this code is not:

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "directory", 4)

They both open the application, the first one open the file also, but the
second one doesn't.

Thanks,
Afshin




A-DESIGN

fileopen
 
Thanks for the quick answer

"JulieD" wrote in message
...
Hi at a quick glance try the following,

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & directory , 4)


by placing "" around directory you made it a string rather than a variable

Cheers
JulieD

"A-Design" wrote in message
...
Hi,
Can anyone please tell me why this code is working:

fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "c:\04987.ecw", 4)

and this code is not:

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "directory", 4)

They both open the application, the first one open the file also, but the
second one doesn't.

Thanks,
Afshin






JulieD

fileopen
 
you're welcome, does it work?

"A-Design" wrote in message
...
Thanks for the quick answer

"JulieD" wrote in message
...
Hi at a quick glance try the following,

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & directory , 4)


by placing "" around directory you made it a string rather than a
variable

Cheers
JulieD

"A-Design" wrote in message
...
Hi,
Can anyone please tell me why this code is working:

fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "c:\04987.ecw",
4)

and this code is not:

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "directory", 4)

They both open the application, the first one open the file also, but
the second one doesn't.

Thanks,
Afshin








A-DESIGN

fileopen
 
Yes ,Thanks.

"JulieD" wrote in message
...
you're welcome, does it work?

"A-Design" wrote in message
...
Thanks for the quick answer

"JulieD" wrote in message
...
Hi at a quick glance try the following,

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & directory , 4)

by placing "" around directory you made it a string rather than a
variable

Cheers
JulieD

"A-Design" wrote in message
...
Hi,
Can anyone please tell me why this code is working:

fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "c:\04987.ecw",
4)

and this code is not:

dim directory as string
directory = "c:\04987.ecw"
fileopen = Shell("C:\Program Files\EC55\ec55.exe " & "directory", 4)

They both open the application, the first one open the file also, but
the second one doesn't.

Thanks,
Afshin











All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com