Excel 2005 Datasource

Posted on 2007-08-09
Last Modified: 2012-05-05
I have an Excel 2003 file with a SQL Server Datasource feeding the data.

Is there any way I can get the data to refresh on the file opening?
Question by:lrbrister
    LVL 85

    Accepted Solution

    Right-click the querytable, choose Data Range Properties and check the option to refresh on Workbook open.
    LVL 6

    Expert Comment

    record a macro of the data refresh and save it with the name Workbook_Open in the workbook object(This Workbook) or edit it and move it to the workbook object. Then when you open the workbook this macro will run.
    LVL 17

    Expert Comment

    Try this code in your ThisWorkbook VBA environment window:

    Private Sub Workbook_Open()


    End Sub

    Author Comment

      I cannot believe that I didn't follow the first rule of Microsoft.  When in doubt right-click.

    Points being awarded now.  Great job...and first too!
    LVL 85

    Expert Comment

    by:Rory Archibald
    Glad to help - thanks for the grade.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    In Excel how to add formula for Quintile? 4 23
    Using "ScreenUpdating" 6 36
    Employees list 3 31
    Surpressing messages VBA 9 31
    Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now