Okay, so I haven't adapted this code to your particular situation, but it seems to work. It actually imports the table instead of linking to it. Here it is:
Dim oAccess As Access.Application
Dim sDatabaseName As String
Set oAccess = New Access.Application
sDatabaseName = "h:\program files\microsoft visual studio\vb98\nwind.mdb"
oAccess.OpenCurrentDatabas
oAccess.DoCmd.TransferSpre
oAccess.CurrentDb().Close
Set oAccess = Nothing
End Sub
I think an adaptation of this code may solve your problem. It not, let me know.
Main Topics
Browse All Topics





by: ryanvsPosted on 1999-04-07 at 08:08:57ID: 1502776
Does it work if you remove the line:
.Connect = dataSource
Connect is used to specify the source of data for a sql pass-through query or linked table. So it looks like you are pointing the table back to Excel with the connect string.