I am using the following code to open a picture viewer via vba
	
	
	
		
Then this code to close the viewer
	
	
	
		
This all works but the viewer being used must be named specifically via "sViewer" which is included in the "sPath" in the opening code.,
How does one determine the default viewer programmatically so the code will run on multiple work stations.
Google is a bit coy with it's answers.
 
		Code:
	
	
	oShell.NameSpace(0).ParseName(sPath).InvokeVerb "Open"Then this code to close the viewer
		Code:
	
	
	Dim Exe As Object
    For Each Exe In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = '" & sViewer & "'")
        Exe.Terminate
    NextHow does one determine the default viewer programmatically so the code will run on multiple work stations.
Google is a bit coy with it's answers.
 
	 
 
		 
 
		 
  
 
		 
 
		 
 
		 
 
		 
 
		