Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Unanswered: Excel automation question

    Hello all, hope someone might help me in this. I have an access 2002 code where I am creating a spreadsheet (filling it up with numbers anf do some formatting etc.). The problem is once my code finsihes dumping all the data into an existing excel files and I open the excel file, the file is opened as hidden and every time I have to go into its excel menu to unhide it.

    Does anyone kows how I can make these files unhidden from the start. I know that once I unhide the file and saves it, then from there onwards it always remains unhidden. But as soon as I again run my process to dump data in it, it becomes hidden again.

    TIA

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Put this in your code

    Excel.Application.Visible = True 'shows excel
    Excel.Application.PARENT.Windows(1).Visible = True 'shows workbook

    I don't know if both are necessary, but I'm using both in code I wrote years ago, and it works fine.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    Thanks for the reply, but my problem is when I try to open these excel files within MS Excel, they comeup as hidden and I have to go into Excel window menu and have to unhide the worksheet. This happens everytime I run my process.

    What you suggested was to open and show the spreadsheet right from MS Access. This is not what is needed here. But thanks anyway. Anyone else has any other solution.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Are you using the DoCmd.OutputTo function?
    If not - how are you populating this spreadsheet.

    Please clarify what exactly comes up as "hidden"
    - is it certain columns?
    - is it the sheet itself?

    - GeorgeV
    George
    Home | Blog

  5. #5
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    I am using excel worksheet objects and dumping data into it thru recordset objects. Cann't post the whole code as it is too long but here is a bit of excel object decclaration

    Set xlw = GetObject(strFile)
    Set xls = xlw.Sheets("Sheet1")

    As for your second question, the whole work sheet is hidden. and I have to go thru the extra steps of unhiding it. Thats what troubling me.

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ni idea what you mean by "hidden" either.
    In any event - does this help:
    http://www.dbforums.com/showpost.php...81&postcount=4
    ??
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •