Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Narcoossee, Florida

    Question Unanswered: Update Access Table from within Excel

    I have a project that I am working on and I am new to VB but has manage to accomplish quite a bit of experience.

    I am using Excel 2000 and Access 2002. I have linked tables within access from excel. My main excel workbook contains different worksheets that holds the information that is linked to the tables within access.

    My questions is how do I update these linked table within access when I open any saved workbook from excel. Below is my VB for opening any excel spreadsheet for editing. When it opens I want the spreadsheet to automatically update the links within access.

    Public Sub EditProjectNumber()
    Dim xl As Object
    Dim Wb As Object
    Dim sht As Object
    Set xl = Excel.Application
    ' If you want Excel to appear, use next line:
    xl.Visible = True

    xl.Dialogs(xlDialogOpen).Show "C:\Cost"
    Set Wb = xl.ActiveWorkbook
    Set sht = Wb.Sheets("PROJECT")
    End Sub

    This works perfectly for opening any excel spreadsheet.

    Also is there a way to rename the workbook and link that workbook to access when it is opened.

    The above VB is in access.

    Thank you.

  2. #2
    Join Date
    Nov 2002
    For import of data from an Excel workbook to a table in database you can use as reference:

    If you want that the data transfer to be performed each time you open the workbook I suggest to include the code in a Workbook_Open event procedure attached to the workbook.

Posting Permissions

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