Hi. New here and not much experience with vba coding.. need help to problem where I couldn't find answer from forums
I have excel macro that continuously (every 2 minutes) Publish .htm page to network drive. Some times (once a day) the macro stops working when save operation does not end - there is Save dialog box on the screen. When I click "Cancel", macro continue normally.
Publish as method used:
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange, _
Filename:="\\Server\Stockreport.htm", Sheet:="First Quarter", Source:="$G$3:$H$6", _
HtmlType:=xlHtmlStatic, DivID:="Book1_4170")
.Publish (True)
.AutoRepublish = False
End With
Question is how vba macro could automatically cancel the saving if it takes more that 5 sec?
I was thinking to use SendKeys method to push "Cancel" button in dialog box, but I do not know how to put that into script so that it would work...
Any better idea instead of SendKeys method?
I have excel macro that continuously (every 2 minutes) Publish .htm page to network drive. Some times (once a day) the macro stops working when save operation does not end - there is Save dialog box on the screen. When I click "Cancel", macro continue normally.
Publish as method used:
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange, _
Filename:="\\Server\Stockreport.htm", Sheet:="First Quarter", Source:="$G$3:$H$6", _
HtmlType:=xlHtmlStatic, DivID:="Book1_4170")
.Publish (True)
.AutoRepublish = False
End With
Question is how vba macro could automatically cancel the saving if it takes more that 5 sec?
I was thinking to use SendKeys method to push "Cancel" button in dialog box, but I do not know how to put that into script so that it would work...
Any better idea instead of SendKeys method?