Created
January 22, 2022 03:53
-
-
Save ba5tz/563c7da8593bc82967143c41e956da7d to your computer and use it in GitHub Desktop.
VBA Webcam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' WebCam VBA by Andi Setiadi | |
' Blog [ setiadi.my.id | arrayformula.com ] | |
Sub Webcam() | |
Const FileCam As String = "image.bmp" | |
Const ModCam As String = "CommandCam.exe" | |
ChDir ThisWorkbook.Path | |
If Dir(FileCam) > "" Then Kill (FileCam) | |
Shell ModCam, vbHide | |
While Dir(FileCam) = "" | |
when | |
Application.Wait (Now + TimeValue("00:00:01")) | |
Image1.Picture = LoadPicture(FileCam) | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment