Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default How to open another program and file?

Excel 2003

Is there a way to make a macro open a specific file within a specific
program, or to launch a specific program and then open a specific file
in it?

The file:
C:\Images\MyPic.jpg

The program:
C:\Program Files\IrfanView\i_view32.exe

(It doesn't work to just open the jpg file using a simple link because
Excel by design opens jpg's in Internet Explorer, not the associated
program, and I don't want it opening in IE.)

Thanks,
Melina

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default How to open another program and file?

The program would have to support VBA to be able to issue commands to the
application.


"Mel" wrote in message
...
Excel 2003

Is there a way to make a macro open a specific file within a specific
program, or to launch a specific program and then open a specific file
in it?

The file:
C:\Images\MyPic.jpg

The program:
C:\Program Files\IrfanView\i_view32.exe

(It doesn't work to just open the jpg file using a simple link because
Excel by design opens jpg's in Internet Explorer, not the associated
program, and I don't want it opening in IE.)

Thanks,
Melina



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default How to open another program and file?

Mel wrote:
Excel 2003

Is there a way to make a macro open a specific file within a specific
program, or to launch a specific program and then open a specific file
in it?

The file:
C:\Images\MyPic.jpg

The program:
C:\Program Files\IrfanView\i_view32.exe

(It doesn't work to just open the jpg file using a simple link because
Excel by design opens jpg's in Internet Explorer, not the associated
program, and I don't want it opening in IE.)

Thanks,
Melina


Have you tried something like this (in VBA)?

Shell "C:\Program Files\IrfanView\i_view32.exe C:\Images\MyPic.jpg"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default How to open another program and file?

Look at Shell

Dim RetVal
Dim ProgPath as string
Dim FilePath As String

ProgPath = "C:\Program Files\IrfanView\i_view32.exe"
FilePath = "C:\Images\MyPic.jpg"
RetVal = Shell(ProgPath & " " & Filename, 1)



Tim


"Mel" wrote in message
...
Excel 2003

Is there a way to make a macro open a specific file within a specific
program, or to launch a specific program and then open a specific file
in it?

The file:
C:\Images\MyPic.jpg

The program:
C:\Program Files\IrfanView\i_view32.exe

(It doesn't work to just open the jpg file using a simple link because
Excel by design opens jpg's in Internet Explorer, not the associated
program, and I don't want it opening in IE.)

Thanks,
Melina



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default How to open another program and file?

You guys are so awesome I can't stand it. <g Thanks, Tim. It worked
perfectly. That was too cool. I will read about Shell on my own now to
find other ways to apply it in my tasks. I love it!

-Melina

On Oct 8, 10:56*pm, "Tim Williams" wrote:
Look at Shell

Dim RetVal
Dim ProgPath as string
Dim FilePath As String

ProgPath = "C:\Program Files\IrfanView\i_view32.exe"
FilePath = "C:\Images\MyPic.jpg"
RetVal = Shell(ProgPath & " " & Filename, 1)

Tim

"Mel" wrote in message

...

Excel 2003


Is there a way to make a macro open a specific file within a specific
program, or to launch a specific program and then open a specific file
in it?


The file:
C:\Images\MyPic.jpg


The program:
C:\Program Files\IrfanView\i_view32.exe


(It doesn't work to just open the jpg file using a simple link because
Excel by design opens jpg's in Internet Explorer, not the associated
program, and I don't want it opening in IE.)


Thanks,
Melina


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
no program registered to open this file lemorse Excel Discussion (Misc queries) 1 September 27th 09 09:28 PM
Excel program remains open after closing file RPC Excel Discussion (Misc queries) 9 February 7th 08 07:59 PM
Diff between clicking on a file and using file open w/in program? rkcl Excel Discussion (Misc queries) 1 February 8th 06 12:43 PM
how to open a dgx file on excel or another program mridul Setting up and Configuration of Excel 1 July 17th 05 06:57 AM
Open a file o the program that was created Luis Excel Programming 0 December 4th 03 06:08 PM


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"