问题
I am attempting to just open the "Camera" app on a MS Surface tablet (Running Windows 8.1) using VBA, written in MS Access 2013 (VBA version is 7.1).
I have used this Shell("C:\Windows\System32\write.exe")
in the past, and it does what I need. (This just opens up Wordpad).
However, using the same code for the Camera app doesn't run it. Shell("C:\Windows\Camera\camera.exe"
I went to the camera's directory, double clicked on the .exe, and it still doesn't open. It pops up in task manager for a second or two, then disappears.
When I press the Windows Key .. and tap on the Camera app ... the app opens successfully.
Is there a way I can get VBA to open this camera app correctly? (Just to clarify; I don't need the app to return anything, I just want to open it).
Thank you for your time!
Ben
回答1:
If anyone is interested I have found a work-around for this problem. I used this website to help create a Shortcut to the Camera App. I then used VBA to run the Shortcut. Works well enough for what I need to do! The code to run the link is as follows......
Dim MyFile As String
Dim Cmd As String
MyFile = "C:\Users\Name\Desktop\CameraTest.lnk"
Cmd = "RunDLL32.EXE shell32.dll,ShellExec_RunDLL "
Shell (Cmd & MyFile)
来源:https://stackoverflow.com/questions/28036527/open-windows-8-1-camera-app-with-vba