Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    10

    Unanswered: Opening an excel file from access

    I am trying to open an excel file from Access, using vba using:

    On Error GoTo Err_cmdDatLevelRpt_Click

    Dim oApp As Object
    Set oApp = CreateObject("Excel.Application")
    oApp.Visible = True

    oApp.Workbooks.Open FileName:="\FILE PATH etc...."

    Exit_cmdDatLevelRpt_Click:
    Exit Sub

    Err_cmdDatLevelRpt_Click:
    MsgBox Err.Description
    Resume Exit_cmdDatLevelRpt_Click

    End Sub

    The excel file is linked to a data source and is set to refresh on open. The problem I have is that when I open the excel file via access, excel does not refresh the data. However when I open the excel file via excel it does refresh!!. Im a bit stumped..any thoughts?

  2. #2
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    have you tried the "application.followhyperlink" method?
    Access XP & WinXP Pro

  3. #3
    Join Date
    Nov 2003
    Posts
    10
    ive just ried it with :

    Application.FollowHyperlink "\\Plympdc\data\Positive Response\Data\Responses\PRDaily.txt", True


    The same happened, it did not refresh the data

  4. #4
    Join Date
    Nov 2003
    Posts
    10

    Talking

    opps correction.....It did work! thanks very much..

Posting Permissions

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