Shell ("C:\QRScan.bat")
kodunun olduğu formun modülüneaşağıdaki kodu ekleyin
#If VBA7 And Win64 Then '64 bit için
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#Else '32 bit için
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#End If
Const SW_SHOWNORMAL = 1
sonrada Shell ("C:\QRScan.bat")
kodunu aşağıdaki kodla değiştirerek deneyinbat dosyası içine yazdığınız kodları bilmiyorum ama shell komutunun içine gömemez misiniz o kodları?
dilerim işinize yarar
ShellExecute 0, "runas", "C:\QRScan.bat", "", vbNullString, SW_SHOWNORMAL