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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank Excel spreedshet after modifying it. 1

Status
Not open for further replies.

depacho

Programmer
Aug 26, 2005
6
US
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.

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
 
You may try this:
objXLBook.Application.Visible = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you PHV, you always prompt to answer questions.

I tried this but it didn't work, but I found what is the problem. For some reason it HIDES the spreadsheet. a tried hide= False attribute but it says that this is not an attribute. Any ideas?

Thank you again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top