PublishObjects lockup




HOW CAN I MODIFY THIS SCRIPT TO PREVENT LOCKUP IN THE CASE OF FAILURE?

I would appreciate suggestions on how to keep my code from crashing
Excel when the destination server for PublishObjects is not available.

Here's the code that causes the crash when the destination is
unavailable:


Code:
--------------------
rPath = Range("A1").Value 'full path to the source XLS file
mOutput = "https://mySPSsite/sites/sitename/DSR-MonthToDate.mht";
With ActiveWorkbook.PublishObjects("12-December-DSR_23618")
.HtmlType = xlHtmlStatic
.Filename = mOutput
.Publish (False)
.AutoRepublish = False
End With
ChDir rPath
--------------------


This is part of the code which is autorun when the file is opened. I
have setup task scheduler to execute this every night so that the file
will export the MHT files to the SharePoint web server.

On some occasions, the save fails due to SPS server or connectivity
issues and causes the Excel process to freeze. Since it's run as a
task in a separate session, i can't do anything but kill the task.

QUESTIONS


- How do I keep this command from locking up Excel when the
destination is unavailable?
- How do I excecute a subroutine when it fails?
- Is there any way to include HTTPS login information in the
PublishObjects command?


I want to capture the error in a variable, abort the script then run a
subroutine that sends a notification.


--
ICE9
------------------------------------------------------------------------
ICE9's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=13565
View this thread: http://www.excelforum.com/showthread.php?threadid=547566

.



Relevant Pages

  • Re: workbooks.open function fails to open an existing excel file when used in ASP, but works in VB.
    ... Just reading the script there doesn't seem to be anything wrong with it, ... excel is definitely not recommended as a server side application. ...
    (microsoft.public.excel.programming)
  • Re: Secure Form Script?
    ... > hijacking web forms? ... the destination address ... > such a script to change the destination address and point it at a list ... It's usually not sufficient to store the to addresses on the server ...
    (Focus-Linux)
  • Re: Excel export problem
    ... I have tested out using just the first 2 header statements on a server ... excel, or excel has to be already open for it to open from the link. ... I have this script to export mysql data to excel. ... Internet Explorer cannot download export.php from "IP Address" (this is ...
    (php.general)
  • How to out results in a web Page
    ... I was working on a script which pull the data from a server, ... some results and export it to EXCEL. ...
    (comp.lang.tcl)
  • Re: Script for your enjoyment
    ... The description inside the script isn't very clear but I'm ... Since my writelog assumes that oFso is set to CreateObject, ... and then display an output in excel. ... > spreadsheet with the server, user name, and path in use. ...
    (microsoft.public.scripting.wsh)