Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Thanked 0 Times in 0 Posts

    AutoExec or AutoOpen (2000)

    I have an Access db that has a macro exporting info as an .xls spreadsheet. The reason I'm not using Excel db query is due to the fact that the tables in Access are actually linked .dbt files. When I tried to run the query function, the info wouldn't show up. Is there something I am doing wrong?

    So, I decided that I would export the info from Access and have it replace an existing spreadsheet. After I say yes, replace the existing spreadsheet, I tried to create an AutoOpen macro in my personal macro workbook that changes some formatting, does some counts and hides some columns. Problem is, it seems like the AutoOpen macro is running before the existing spreadsheet is replaced, because I can see in the background the changes being made, and then disappearing. Any help would be appreciated.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Weert, Limburg, Netherlands
    Thanked 0 Times in 0 Posts

    Re: AutoExec or AutoOpen (2000)

    What you could do is interrupt the auto_open macro so Excel/Access are given time to update the workbook:

    Sub Auto_Open()
    Application.OnTime Now + timevalue("00:00:01"),"ContinueOpen"
    End Sub

    Sub ContinueOpen()
    'Rest of the processing code goes here
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    Professional Office Developers Association

Posting Permissions

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