Results 1 to 2 of 2

Using VBA in Access to Open Excel File

This is a discussion on Using VBA in Access to Open Excel File within the Microsoft Access forums, part of the Question Forums category; I really need some help on this one. I have the following: An Excel file named "C:\Excel1.xls" An Access database ...

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Tulsa, OK
    Posts
    318

    Default Using VBA in Access to Open Excel File

    I really need some help on this one.

    I have the following:
    An Excel file named "C:\Excel1.xls"
    An Access database [db1]
    An Access Form [Form1]
    ActiveX Textbox Controls on [Form1]: [Event Date], [Classification], [Resolution]

    While in the Access [db1], I need to open "C:\Excel1.xls" with the press of a command button found on Access [Form1]. Then I need Excel cells A1, A2, and A3 to be set to [Event Date], [Classification], and [Resolution] values.

    Please Help!
    - Jim

    (Office 2010)


    "The impossible just hasn't been figured out yet."

  2. #2
    Board Regular
    Join Date
    Jun 2008
    Posts
    63

    Default Re: Using VBA in Access to Open Excel File

    This code should allow you to open excel using a button in a form. I works for me. I am not sure how to do the rest.

    Private Sub Command57_Click()


    Dim xlTmp As Excel.Application
    Set xlTmp = New Excel.Application
    xlTmp.Workbooks.Open "C:\Excel1.xls"
    xlTmp.Visible = True

    End Sub

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com