Hi I have the following code:
It just modifies (adds footer and headers ) some spreadsheet that I just exported from Access. For some reason when I open this spreadsheet, the spreadsheet doesn't appear I have to go to WINDOW and then UNHIDE and select the workbook. I have try to add HIDE = FALSE to the code but it seems that this is not an attribute. Anyone knows how to do this in VB? and why the workbook is HIDING?
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(sFilePath & sTableName)
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.Application.Visible = True
Set objXLSheet = Nothing
Set objXLBook = Nothing
Set objXLApp = Nothing
It just modifies (adds footer and headers ) some spreadsheet that I just exported from Access. For some reason when I open this spreadsheet, the spreadsheet doesn't appear I have to go to WINDOW and then UNHIDE and select the workbook. I have try to add HIDE = FALSE to the code but it seems that this is not an attribute. Anyone knows how to do this in VB? and why the workbook is HIDING?
Thank you