我的任务是迁移旧版应用程序以在Windows 10上工作,而我几乎可以正常工作。但是,有一个按钮可将数据导出到excel文件。当我按下它时,会产生错误“错误3274,外部表不是预期的格式”,我认为这是因为excel的定义版本对于已安装的版本不正确。但是我不知道如何更改它。调试代码将我带到以下行:
Set xdbase = OpenDatabase(xfile, 0, 0, "Excel 5.0;")
有什么想法吗?
Dim xdbase As Database
Dim xtable As TableDef
Dim xrecset As Recordset
Dim xfile As String
Set DB = OpenDatabase(dbpath)
'LOCALPATH added 26-2-08 so that it is possible to export to excel when other users have it open
LOCALPATH = "C:\HAFT"
xfile = LOCALPATH & "\dieinfo.xls"
If Dir(xfile) <> "" Then Kill xfile
Set xdbase = OpenDatabase(xfile, 0, 0, "Excel 5.0;")
Set xtable = xdbase.CreateTableDef("id")