Access导出到excel报错renamed invalid sheet name
renamed invalid sheet name
DoCmd.OutputTo acOutputStoredProcedure, spStatement, acFormatXLS, file & ".xls"
写了一个存储过程
将存储过程的结果存到excel文件里面
可以执行成功并且生成文件
但不知道为什么打开会报错。接待方案
renamed invalid sheet name
应该
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
"Employees", "C:\Employees.xlsx", True
,将SP的结果保存为SQLSERVER表,假设使用SQLSERVER2000
SELECT * INTO [EXCEL 8.0;DATABASE=R:\TEMP\123.XLS].[SHEET1]
FROM [ODBC;Driver=SQL Server;UID=sa;PWD=123;Server=tmp;DataBase=tmp];