ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   run time error (https://www.excelbanter.com/excel-discussion-misc-queries/65794-run-time-error.html)

nuti

run time error
 
hi folks..
wheni m trying to run my vba im gettin this run time error at this
line..

lRet = objWSH.Run(sCmd, 0, True)


runtime error : '2147024894(80070002)':
method "Run" od object 'Iwshshell3' failed.

snippet of the code...
-------------------------------------------------------
----------------------------------------------------
Set objWSH = CreateObject("WScript.Shell")
--------------------------------------------------------
sCmd = "DNSCMD " & strDNSServer & " /recordadd " & strDNSZone & " " &
strAlias & " " & strtype & " " & strIPAddr
LogToLog "running:" & sCmd
lRet = objWSH.Run(sCmd, 0, True)


If lRet = 0 Then
LogToLog "successfully created DNSAlias " & strAlias & " for
IP-address " & strIPAddr & " on " & strDNSServer & "." & strDNSZone &
"."
Else
LogToLog "*** !!! Error by DNSAlias creation " & strAlias & "
for IP-address " & strIPAddr & " on " & strDNSServer & "." & strDNSZone
& "."
lCountErrors = lCountErrors + 1
End If

cheers,
Nuti



All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com