![]() |
Open a file from excel-2
Can anyone please tell me how should I write my codes to open a file like
the example below?what ever I tried ,this doesn't work. Sub test_1() FILEOPEN = Shell ("c:\Program Files\EC55\EC55.EXE" & "\\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw", vbMaximizedFocus) End Sub |
Open a file from excel-2
This does work for me:
fileOpen = Shell("C:\WINDOWS\notepad.exe " & "c:\test.txt", vbMaximizedFocus) Also, I notice that you forget the space after the *.exe file, you should be trying to achieve a string like this: "c:\Program Files\EC55\EC55.EXE \\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw" which means that you should write this: FILEOPEN = Shell ("c:\Program Files\EC55\EC55.EXE " & "\\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw", vbMaximizedFocus) However, I have never tried to use this code with an unmapped server address, so can't guarantee it'll work after you correct the code. regards, KL "A-Design" wrote in message ... Can anyone please tell me how should I write my codes to open a file like the example below?what ever I tried ,this doesn't work. Sub test_1() FILEOPEN = Shell ("c:\Program Files\EC55\EC55.EXE" & "\\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw", vbMaximizedFocus) End Sub |
Open a file from excel-2
KL,
With this new string and also the old one I can call the program that I want but the file that I specified doesn't open on that program until I go to menu and try to open it that way, although out side of the excel with just a simple double click on the file I can have it open by that program. Thanks, Afshin. "KL" wrote in message ... This does work for me: fileOpen = Shell("C:\WINDOWS\notepad.exe " & "c:\test.txt", vbMaximizedFocus) Also, I notice that you forget the space after the *.exe file, you should be trying to achieve a string like this: "c:\Program Files\EC55\EC55.EXE \\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw" which means that you should write this: FILEOPEN = Shell ("c:\Program Files\EC55\EC55.EXE " & "\\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw", vbMaximizedFocus) However, I have never tried to use this code with an unmapped server address, so can't guarantee it'll work after you correct the code. regards, KL "A-Design" wrote in message ... Can anyone please tell me how should I write my codes to open a file like the example below?what ever I tried ,this doesn't work. Sub test_1() FILEOPEN = Shell ("c:\Program Files\EC55\EC55.EXE" & "\\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw", vbMaximizedFocus) End Sub |
Open a file from excel-2
Kl,
Please disregard my previous post, the new string works perfect, the problem was the file name. Thanks Afshin "KL" wrote in message ... This does work for me: fileOpen = Shell("C:\WINDOWS\notepad.exe " & "c:\test.txt", vbMaximizedFocus) Also, I notice that you forget the space after the *.exe file, you should be trying to achieve a string like this: "c:\Program Files\EC55\EC55.EXE \\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw" which means that you should write this: FILEOPEN = Shell ("c:\Program Files\EC55\EC55.EXE " & "\\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw", vbMaximizedFocus) However, I have never tried to use this code with an unmapped server address, so can't guarantee it'll work after you correct the code. regards, KL "A-Design" wrote in message ... Can anyone please tell me how should I write my codes to open a file like the example below?what ever I tried ,this doesn't work. Sub test_1() FILEOPEN = Shell ("c:\Program Files\EC55\EC55.EXE" & "\\Server\job-dwg-calc\2004\A3-ENERCALC\04021.ecw", vbMaximizedFocus) End Sub |
All times are GMT +1. The time now is 03:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com