View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
videor videor is offline
external usenet poster
 
Posts: 4
Default Displaying jpegs.

I had done that. But based on your assurance that was what should be done, I
did a little troubleshooting and found the problem:

The call as you sent it was: (without quotes)

"RetVal = ShellExecute(Application.hwnd, "open", FileName, vbNullString,
"C:\", SW_SHOWNORMAL)"

I changed it to:

"RetVal = ShellExecute(hwnd, "open", FileName, vbNullString,
"C:\", SW_SHOWNORMAL)"

and that seems to work. Any reason not to do it that way?

Thanks for all the help.

bern

"NickHK" wrote in message
...

This is part of the Windows API. Excel/VBA know nothing about it, so you
have include the declarations that I included, in the top section of the
code module:

Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As
String,
ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1

NickHK