+ Reply to Thread
Results 1 to 4 of 4

Help with shell command

  1. #1
    St
    Guest

    Help with shell command

    I can't seem to google this answer. I have a button in a spreadsheet that is
    supposed to open a TIFF file. There are 3-4 users, and they all have
    different default applications that open the TIFF format. How can I shell
    open the TIFF files with whatever the default opener for that file type?

    On my computer, it looks like this:

    Private Sub OpenImage(FileName)

    Dim OpenImaging

    OpenImaging = Shell("C:\Program Files\Windows
    NT\Accessories\ImageVue\kodakimg.exe
    (continue same line) K:\Imagefolder\" & FileName & ".tif", 1)

    End Sub

    But I know that I will not work on the other comps. Help, please!



  2. #2
    Gary''s Student
    Guest

    RE: Help with shell command

    Remember that cmd.exe has access to the file associations

    You can by-pass the application and go right to the file:

    x = Shell("cmd.exe /c C:\UserGuide.pdf", 1)

    cmd.exe will know to use the Reader if the full Acrobat is not installed.

    --
    Gary''s Student


    "St" wrote:

    > I can't seem to google this answer. I have a button in a spreadsheet that is
    > supposed to open a TIFF file. There are 3-4 users, and they all have
    > different default applications that open the TIFF format. How can I shell
    > open the TIFF files with whatever the default opener for that file type?
    >
    > On my computer, it looks like this:
    >
    > Private Sub OpenImage(FileName)
    >
    > Dim OpenImaging
    >
    > OpenImaging = Shell("C:\Program Files\Windows
    > NT\Accessories\ImageVue\kodakimg.exe
    > (continue same line) K:\Imagefolder\" & FileName & ".tif", 1)
    >
    > End Sub
    >
    > But I know that I will not work on the other comps. Help, please!
    >
    >
    >


  3. #3
    St
    Guest

    Re: Help with shell command

    Thank you Gary's student. That should work.

    "Gary''s Student" <GarysStudent@discussions.microsoft.com> wrote in message
    news:23426C16-8983-46B8-8760-6185F65B1986@microsoft.com...
    > Remember that cmd.exe has access to the file associations
    >
    > You can by-pass the application and go right to the file:
    >
    > x = Shell("cmd.exe /c C:\UserGuide.pdf", 1)
    >
    > cmd.exe will know to use the Reader if the full Acrobat is not installed.
    >
    > --
    > Gary''s Student
    >
    >
    > "St" wrote:
    >
    > > I can't seem to google this answer. I have a button in a spreadsheet

    that is
    > > supposed to open a TIFF file. There are 3-4 users, and they all have
    > > different default applications that open the TIFF format. How can I

    shell
    > > open the TIFF files with whatever the default opener for that file type?
    > >
    > > On my computer, it looks like this:
    > >
    > > Private Sub OpenImage(FileName)
    > >
    > > Dim OpenImaging
    > >
    > > OpenImaging = Shell("C:\Program Files\Windows
    > > NT\Accessories\ImageVue\kodakimg.exe
    > > (continue same line) K:\Imagefolder\" & FileName & ".tif", 1)
    > >
    > > End Sub
    > >
    > > But I know that I will not work on the other comps. Help, please!
    > >
    > >
    > >




  4. #4
    Adam
    Guest

    Re: Help with shell command

    Hey St,

    Try using the System.Windows.Froms.Application.StartUpPath to get the
    path to your .exe and append the name of the .exe to the path.

    Private Sub OpenImage(FileName)

    Dim OpenImaging

    OpenImaging = Shell(System.Windows.Froms.Application.StartUpPath &
    "kodakimg.exe K:\Imagefolder\" & FileName & ".tif", 1)

    End Sub



    St wrote:
    > I can't seem to google this answer. I have a button in a spreadsheet that is
    > supposed to open a TIFF file. There are 3-4 users, and they all have
    > different default applications that open the TIFF format. How can I shell
    > open the TIFF files with whatever the default opener for that file type?
    >
    > On my computer, it looks like this:
    >
    > Private Sub OpenImage(FileName)
    >
    > Dim OpenImaging
    >
    > OpenImaging = Shell("C:\Program Files\Windows
    > NT\Accessories\ImageVue\kodakimg.exe
    > (continue same line) K:\Imagefolder\" & FileName & ".tif", 1)
    >
    > End Sub
    >
    > But I know that I will not work on the other comps. Help, please!
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1