If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Update Access Table from within Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-02, 16:33
divinedar0956 divinedar0956 is offline
Registered User
 
Join Date: Nov 2002
Location: Narcoossee, Florida
Posts: 1
Question 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.
Reply With Quote
  #2 (permalink)  
Old 11-28-02, 23:51
corni corni is offline
Registered User
 
Join Date: Nov 2002
Posts: 4
For import of data from an Excel workbook to a table in database you can use as reference:

http://smsconsulting.spb****/shamil_s...s/impbcdb0.htm

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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On