Script VBA Akses WebCam

Cara mengakses dan menggunakan Webcam dengan Script VBA

Sub Webcam()
'-----------------------------------------
' Sctipt VBA    : VBA WebCam
' Author        : https://vba.co.id
'                 Situs belajar VBA No.1
'                 di Indonesia
'-----------------------------------------
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

Script diatas menggunakan aplikasi tambahan yaitu commandcam, aplikasi ini bisa didownload disini : CommandCam

Tagged with:
Controls

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat WhatsApp
WhatsApp