Hi All,
I have the following code. It is something that I have used many times and this time when I try to open the excel file, excel opens but I do not get anything (not even a blank new spreadsheet), can any one help me?
Thank you.
I have the following code. It is something that I have used many times and this time when I try to open the excel file, excel opens but I do not get anything (not even a blank new spreadsheet), can any one help me?
Thank you.
Code:
Dim objXLApp As Excel.Application
Dim objXLBook As Excel.workbook
Dim objXLSheet As Excel.worksheet
Dim sHeader, sFooter, sDay As String
Set objXLBook = GetObject ("FileName")
Set objXLApp = objXLBook.Parent
Set objXLSheet = objXLBook.Worksheets("AE_CDSS")
objXLSheet.PageSetup.CenterHeader = sHeader
objXLSheet.PageSetup.CenterFooter = sFooter
Set objXLSheet = objXLBook.Worksheets("CHM_CDSS_Final")
objXLSheet.Name = "CHM_CDSS"
objXLSheet.PageSetup.CenterHeader = sHeader
objXLSheet.PageSetup.CenterFooter = sFooter
Set objXLSheet = objXLBook.Worksheets("CM_CDSS")
objXLSheet.PageSetup.CenterHeader = sHeader
objXLSheet.PageSetup.CenterFooter = sFooter
Set objXLSheet = objXLBook.Worksheets("HEM_CDSS_final")
objXLSheet.Name = "HEM_CDSS"
objXLSheet.PageSetup.CenterHeader = sHeader
objXLSheet.PageSetup.CenterFooter = sFooter
objXLBook.Save
Set objXLSheet = Nothing
Set objXLBook = Nothing
Set objXLApp = Nothing