19. juli 2012 - 16:07
Der er
14 kommentarer og 1 løsning
Access Re-link Excel
Jeg har linket et regneark (NyLinkSti, fanen "Priser") til en tabel (Datatabel) og ønsker at ændre det til et andet regneark. og bruger følgende: CurrentDb.TableDefs("Datatabel").Connect = "Excel 8;Database = " & NyLinkSti & "\Priser$" CurrentDb.TableDefs("Datatabel").RefreshLink Den kører igennem uden fejl, men ændre ikke linket. Jeg bruger Office 2010 Hvad skal jeg gøre ?
Annonceindlæg fra Computerworld it-jobbank
try deleting the linked table first and then create new
If I do that, links to other table will not work
? What other table? If you delete first and then create new which one do you mean is other table?
I have an query If I remove the table an replace it with an other with the same name ofcause, I will get an dialogbox, asking for input in the first field in the table when I open it, and the table is emty
Doesnt the second table contain same column names?
Yes it is the same just with different data
Hi Anders If I get time over the weekend then I'll see if I can put some code together for which which hopefully works.
Like that :-) If You need my files you can mail my at Anders@kaas.at and I will send them to you.
22. juli 2012 - 09:18
#10
I have sent you an email
22. juli 2012 - 10:58
#11
do you get prompted to first convert to 2002 - 2003 format? You have to do that first before youare allowed to make an MDE
22. juli 2012 - 11:26
#12
I have actually found out what the problem is. In code view try compiling the database (debug + compile ...) You get an error in module moduler! You need to alter this code so that you dont get an error then you will be able to make your MDE. :o)
16. august 2012 - 15:34
#13
did this solve the problem Anders?
27. august 2012 - 20:40
#14
Thanks the solution was perfect Thank you for a lot of work :-) Function RecreateLink(sTableName, sFileName) As Boolean On Error GoTo Err_Handler Dim sConnect As String Dim sTable As String With CurrentDb On Error Resume Next With .TableDefs(sTableName) sConnect = .Connect sTable = .SourceTableName End With .TableDefs.Delete sTableName On Error GoTo Err_Handler DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel8, sTableName, sFileName, False, "Ark2!A1:G25" End With RecreateLink = True Exit Function
27. august 2012 - 21:08
#15
thank you