LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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...o&userid=13565
View this thread: http://www.excelforum.com/showthread...hreadid=547566

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell Selection Lockup T. Jenkins Excel Discussion (Misc queries) 6 January 30th 08 07:17 PM
Lockup in Office TD Excel Discussion (Misc queries) 0 April 20th 06 07:34 PM
ThisWorkbook.PublishObjects.Add runtime error 1004 itarnak[_12_] Excel Programming 0 October 26th 05 11:26 AM
PublishObjects To A String? James Cox[_2_] Excel Programming 0 June 13th 05 05:07 PM
lockup value gus Excel Programming 2 September 26th 03 11:44 PM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"