Open Windows 8.1 “Camera app” with VBA

ⅰ亾dé卋堺 提交于 2019-12-08 06:17:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!