Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Refresh and Publish Spreadsheet

Status
Not open for further replies.
Apr 25, 2008
10
0
0
US
Hello

We have an app that opens, refreshes and publishes a ton of Excel spreadsheets with pivot tables to a web folder. Most of the spreadsheets update fine. However, one just keeps being published with the data from the exact same date everyday. Below is the code. Section 1 is an example of one process that works fine. Section 2 is the one that never works. Can you help me understand why this would be? Both processes look similar. THANKS!!!

******************************************
****Section 1:****************************
******************************************
//save
workbookPath = "W:/CONS_CRED_ADJ/DAILY DELINQUENCY/Clev 60 & uP Lse.xls";
excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true);
excelWorkbook.SaveCopyAs("W:/CONADMIN/BobM/Clev 60 & uP Lse.xls");
excelWorkbook.Close(false, workbookPath, false);

//refresh all
workbookPath = "W:/CONS_CRED_ADJ/DAILY DELINQUENCY/Clev 60 & uP Lse.xls";
excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true);
excelWorkbook.RefreshAll();
excelWorkbook.Save();
excelWorkbook.Close(false, workbookPath, false);

//WEBSITE
workbookPath = "W:/CONS_CRED_ADJ/DAILY DELINQUENCY/Clev 60 & uP Lse.xls";
excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true);
excelWorkbook.RefreshAll();
excelWorkbook.SaveCopyAs("Q:/reports/coll_rpts/Aging_Delq/Daily/Clev 60 & uP Lse.xls");
excelWorkbook.Close(false, workbookPath, false);

******************************************
****Section 2:****************************
******************************************
//save
workbookPath = "W:/CONS_CRED_ADJ/DAILY DELINQUENCY/Clev 30-59 25K Lse.xls";
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true);
excelWorkbook.Application.DisplayAlerts = false;
excelWorkbook.SaveCopyAs("W:/CONADMIN/BobM/Clev 30-59 25K Lse.xls");
excelWorkbook.Close(false, workbookPath, false);

//refresh all
workbookPath = "W:/CONS_CRED_ADJ/DAILY DELINQUENCY/Clev 30-59 25K Lse.xls";
excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true);
excelWorkbook.RefreshAll();
excelWorkbook.Application.DisplayAlerts = false;
excelWorkbook.Save();
excelWorkbook.Close(false, workbookPath, false);

//WEBSITE
workbookPath = "W:/CONS_CRED_ADJ/DAILY DELINQUENCY/Clev 30-59 25K Lse.xls";
excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true);
excelWorkbook.Application.DisplayAlerts = false;
excelWorkbook.SaveCopyAs("Q:/reports/coll_rpts/Aging_Delq/Daily/Clev 30-59 25K Lse.xls");
excelWorkbook.Close(false, workbookPath, false);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top