0% found this document useful (0 votes)
96 views1 page

Vba - Open TIF File Using MODI

This document contains code snippets for finding and launching executables from within VBA. It uses the FindExecutable function to locate the executable associated with a file type and store the name in a string. It then passes the executable name to Shell to launch it. An alternative method directly shells the path to an executable. Finally, it shows launching the application object associated with the file type.

Uploaded by

info.glcom5161
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views1 page

Vba - Open TIF File Using MODI

This document contains code snippets for finding and launching executables from within VBA. It uses the FindExecutable function to locate the executable associated with a file type and store the name in a string. It then passes the executable name to Shell to launch it. An alternative method directly shells the path to an executable. Finally, it shows launching the application object associated with the file type.

Uploaded by

info.glcom5161
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Declare Function FindExecutable Lib "shell32.

dll" _
Alias "FindExecutableA" (ByVal lpFile As String, _
ByVal lpDirectory As String, ByVal lpResult As String) As
Long
Sub AAA()
Dim FName As String
Dim ExeName As String
FName = ThisWorkbook.Path & Application.PathSeparator &
"__TEMP.tif"
Open FName For Output As #1
Close #1
ExeName = String(255, " ")
FindExecutable FName, "", ExeName
Kill FName
Shell ExeName
End Sub
Sub BBB()
Dim x As Long
x = Shell("C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EX
E", 1)
End Sub
Set oApp = CreateObject("MSPVIEW.Application")

You might also like