【发布时间】:2017-06-02 07:42:26
【问题描述】:
DoCmd.TransferSpreadsheet 方法让我感到非常沮丧。我有一个包含多个工作表的工作簿,用户在其中更新数据,我有一个脚本,可以将所有记录放回一个工作表,链接电子表格,并更新我的 Access DB 中的数据。我的问题出在 Range 参数中。我传递以下字符串并得到以下错误:
DoCmd.TransferSpreadsheet TransferType:=acLink, SpreadsheetType:=acSpreadsheetTypeExcel12Xml, _
TableName:=linkSheet, fileName:=Wb.Path & "\" & Wb.name, _
HasFieldNames:=True, Range:="AccessUpdate!updateTable"
The Microsoft Access database engine could not find the object 'AccessUpdate$updateTable'. Make sure the object exists and that you spell its name and the path name correctly. If 'Access_Update$updateTable' is not a local object, check your network connection or contact the server administrator.
我似乎无法理解为什么它用美元符号代替了爆炸。在理解如何指定范围方面的任何其他帮助也将不胜感激。
谢谢!
【问题讨论】:
-
如果 updateTable 是命名范围,请在此处使用:
Range:="updateTable" -
我尝试简单地引用该表,但我的错误代码说它找不到“updateTable”