Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Run-Time Error 1004

I've automated a few reports using "Workbook_Open"... Which refreshes pivots,
updates charts, etc... At the end of the day it saves the final product to
SharePoint. Its on a scheduler... Most days they run fine however sometimes I
get a Run Time Error.. When this occurs, I don't see till I get in the office
in morning and I hit Debug + F5 and it completes the process... Is there
something I can add to the code to simulate the same step of hitting F5???
Below is where I get hung up

Do
ActiveWorkbook.SaveAs
"http://wellcarelink/sites/CSGeneral/HI_Monthly_Intervals/Monthly/" _
& _
bdFileName & Format(Now(), "_YYYY.MM") & _
".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=True, CreateBackup:=False

Loop Until ActiveWorkbook.Saved = True
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Run-Time Error 1004

Try adding an on error resume next statement...

On Error Resume Next
Do
ActiveWorkbook.SaveAs
"http://wellcarelink/sites/CSGeneral/HI_Monthly_Intervals/Monthly/" _
& _
bdFileName & Format(Now(), "_YYYY.MM") & _
".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=True, CreateBackup:=False

Loop Until ActiveWorkbook.Saved = True
On Error Goto 0

--
HTH...

Jim Thomlinson


"THE_RAMONES" wrote:

I've automated a few reports using "Workbook_Open"... Which refreshes pivots,
updates charts, etc... At the end of the day it saves the final product to
SharePoint. Its on a scheduler... Most days they run fine however sometimes I
get a Run Time Error.. When this occurs, I don't see till I get in the office
in morning and I hit Debug + F5 and it completes the process... Is there
something I can add to the code to simulate the same step of hitting F5???
Below is where I get hung up

Do
ActiveWorkbook.SaveAs
"http://wellcarelink/sites/CSGeneral/HI_Monthly_Intervals/Monthly/" _
& _
bdFileName & Format(Now(), "_YYYY.MM") & _
".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=True, CreateBackup:=False

Loop Until ActiveWorkbook.Saved = True

Reply
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
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Run Time Error '1004' General ODBC Error CLR Excel Programming 6 September 16th 10 11:14 PM
Run Time Error 1004: Application or Object Defined Error BEEJAY Excel Programming 4 October 18th 06 04:19 PM
Run Time 1004 Error: Application or Object Difine Error BEEJAY Excel Programming 0 October 17th 06 10:45 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM


All times are GMT +1. The time now is 08:14 PM.

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

About Us

"It's about Microsoft Excel"