Open a file from excel-2

  • Thread starter Thread starter A-Design
  • Start date Start date
A

A-Design

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
 
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
 
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,
Please disregard my previous post, the new string works perfect, the problem
was the file name.
Thanks
Afshin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top