+ Reply to Thread
Results 1 to 2 of 2

Macro to Refresh Data & Print

  1. #1
    Registered User
    Join Date
    02-01-2006
    Posts
    1

    Macro to Refresh Data & Print

    Hi all,

    I have a small problem.....I am currently using Excel to import some external data from an Oracle database. As this is a report, the process needs to be automated, hence I need a macro.

    I need to generate a macro which refreshes the data in the worksheet, then prints the report out and closes the workbook/applciation.

    I have generated the macro, but the macro prints the report before the data has refreshed.

    Tried various versions of pause/wait/sleep, but still cant get it to work?

    Any ideas would be of great help!

    Many thanks in advance.

  2. #2
    JakeyC
    Guest

    Re: Macro to Refresh Data & Print

    By setting the BackgroundQuery property to False the code (and Excel)
    will wait for the refresh to complete.

    Range("Whatever").QueryTable.Refresh BackgroundQuery:=False should work


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1