Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: Opening a specific .xls file from access

    the code generator gave me the following code, but i couldnt figure out how then to open the file in this code, any ideas?

    M~

    Private Sub Command0_Click()
    On Error GoTo Err_Command0_Click

    Dim oApp As Object

    Set oApp = CreateObject("Excel.Application")

    oApp.Visible = True

    'Only XL 97 supports UserControl Property
    On Error Resume Next
    oApp.UserControl = True

    Exit_Command0_Click:
    Exit Sub

    Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click

    End Sub

  2. #2
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Re: Opening a specific .xls file from access

    Originally posted by mikezcg
    the code generator gave me the following code, but i couldnt figure out how then to open the file in this code, any ideas?

    M~

    Private Sub Command0_Click()
    On Error GoTo Err_Command0_Click

    Dim oApp As Object

    Set oApp = CreateObject("Excel.Application")

    oApp.Visible = True

    'Only XL 97 supports UserControl Property
    On Error Resume Next
    oApp.UserControl = True

    Exit_Command0_Click:
    Exit Sub

    Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click

    End Sub
    If you only want to open an excel-file you can use this :

    Code:
    Private Sub OpenExcel()
        Shell "C:\Program Files\Microsoft Office\Office10\excel.exe myExcelFile.xls"
    End Sub

  3. #3
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    if you want to open a specific file use the hyperlink method
    Access XP & WinXP Pro

Posting Permissions

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