以下命令在命令提示符下工作:
%SystemRoot%\System32\rundll32.exe“C:\Program Files\Windows Photo Viewer\PhotoViewer.dll”,ImageView_Fullscreen C:\Test.jpg
在Excel VBA中,我尝试了几种方法。下面的第一个示例得到53文件未找到。第二个示例似乎正在运行,但没有显示任何内容。
Sub ViewPhoto()
Dim strExe As String
strExe = """%SystemRoot%\System32\rundll32.exe ""%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll"", ImageView_Fullscreen c:\test.jpg"""
MsgBox strExe
'VBA.Shell strExe
strExe = """C:\Windows\System32\rundll32.exe ""%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll"", ImageView_Fullscreen c:\test.jpg"""
MsgBox strExe
VBA.Shell strExe
End Sub
我不想在Excel中嵌入照片。它们经常更新。
以下操作成功打开PhotoViewer:
VBA.Shell "C:\Windows\System32\rundll32.exe ""C:\Program Files\Windows Photo Viewer\PhotoViewer.dll"", ImageView_Fullscreen"
2条答案
按热度按时间gstyhher1#
p3rjfoxz2#
我终于想明白了。照片的完整路径在ActiveCell中,用引号括起来。