linking an excel spreadsheet to an access database using vb 
Author Message
 linking an excel spreadsheet to an access database using vb

Hi all,

I am converting a project  written in VBA to VB.  I have come accross a bit
of a stumbling block.

I need to link an excel spreadsheet to an access table from within VB.  Any
suggestions as to how I could go about doing it??

The code in VBA is as follows:

Private Sub Import_Data_Click()
On Error GoTo Err_Import_Data_Click

    DoCmd.SetWarnings False
    Me.Refresh
    DoCmd.RunSQL "Drop Table [Financial Data Input Sheet];"
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "Financial
Data Input Sheet", Me![Directory Location] & "\" & Me![Input Filename], True
    DoCmd.SetWarnings True

    Call Create_Model
    MsgBox ("Model Data has been successfully imported.")

Exit_Import_Data_Click:
    Exit Sub

Err_Import_Data_Click:
    If Err.Number = 3376 Then
        Resume Next
    Else
        DoCmd.SetWarnings True
        MsgBox Err.Number & " - " & Err.Description
        Resume Exit_Import_Data_Click
    End If

End Sub



Sat, 28 Sep 2002 03:00:00 GMT  
 linking an excel spreadsheet to an access database using vb
Hi Helena,

This group is for MSWORD VBA questions. Someone here may know the answer, but
you'll probably have better success in an ACCESS programming group :-) You
may want to take a look at TABLEDEF object in the DAO Help files.

Quote:
> I am converting a project  written in VBA to VB.  I have come accross a bit
> of a stumbling block.

> I need to link an excel spreadsheet to an access table from within VB.  Any
> suggestions as to how I could go about doing it??

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Sat, 28 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. linking an excel spreadsheet to an access table using vb

2. Excel spreadsheet from an Access database using VB?

3. linking an excel spreadsheet to an access database from vb6

4. linking a excel spreadsheet to an access table through vb

5. Importing Excel Spreadsheet into an Access 2000 Table using VB

6. Prompts to update links when opening Excel spreadsheet from Access

7. Access Linking to Excel Spreadsheets

8. How to link a passwd protected Excel spreadsheet to Access in VB6

9. How to link a password protected Excel 97 Spreadsheet to Access 97

10. Linking excel 97 spreadsheet to VB app

11. Add a row to a spreadsheet using a MS Access DDE-link

12. Using an Excel Spreadsheet as Database

 

 
Powered by phpBB® Forum Software