我有各种.xls文件,我无法在Excel中打开这些文件,因为它们太大。 我一直在试图将它们导入到Access 365中,但得到的错误是Access无法访问文件中的信息。 今天早上我一直在阅读几个论坛的建议,但唯一的建议是不可行的,因为他们需要打开文件并保存在.xlsx中,我不能这样做,因为如上所述我无法打开文件。 任何意见,将不胜感激。将.xls文件导入Access 365
0
A
回答
1
如何获得无法在Excel中打开的Excel文件?您必须在某个时间使用Excel创建文件。正如我所知,唯一的限制是您正在使用的机器上的RAM。
你可以试试下面的脚本吗?
Sub Import()
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String
Dim blnHasFieldNames As Boolean
' Change this next line to True if the first row in EXCEL worksheet
' has field names
blnHasFieldNames = False
' Replace C:\Documents\ with the real path to the folder that
' contains the EXCEL files
strPath = "C:\Documents\"
' Replace tablename with the real name of the table into which
' the data are to be imported
strTable = "tablename"
strFile = Dir(strPath & "*.xls")
Do While Len(strFile) > 0
strPathFile = strPath & strFile
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames
' Uncomment out the next code step if you want to delete the
' EXCEL file after it's been imported
' Kill strPathFile
strFile = Dir()
Loop
End Sub
如果Access不能处理它,我觉得很难相信,你可以使用SQL Server做的工作。
http://www.accessmvp.com/KDSnell/EXCEL_Import.htm
Select * into SQLServerTable FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=D:\testing.xlsx;HDR=YES', 'SELECT * FROM [Sheet1$]')
http://www.ashishblog.com/importexport-excel-xlsx-or-xls-file-into-sql-server/
或者......用R进行此任务。
library(xlsx)
file <- system.file("tests", "test_import.xlsx", package = "xlsx")
res <- read.xlsx(file, 1) # read first sheet
head(res[, 1:6])
http://www.sthda.com/english/wiki/r-xlsx-package-a-quick-start-guide-to-manipulate-excel-files-in-r
如果没有这些选项的工作,我要说的Excel文件可能已损坏,这是一个完全不同的问题。
相关问题
- 1. 将.xls文件导入到java servlet中
- 2. asp和ms-access db - 如何从xls文件导入数据
- 3. 自动将TXT文件导入到xls,并在excel或access中进行规范
- 4. 如何将.sql文件导入MS Access
- 5. MS Access导出为.xls
- 6. MS Access 2003 - 将文本文件导入MS Access数据库表
- 7. 将Excel/XLS导入SSIS?
- 8. SSIS导入Excel文件XLS/XLSX
- 9. PyQt:导入.xls文件并填充QTableWidget?
- 10. 从.xls导入数据文件
- 11. 从文本文件中将值导入到xls
- 12. 将XML文件导入带有转换文件的MS Access
- 13. 如何将一些矩阵写入/导出到XLS文件?
- 14. SSIS导入xls文件并将其拆分为2,空行后
- 15. 将大的xls文件导入mysql数据库
- 16. 如何使用java将.xls文件导入到mysql数据库?
- 17. 将.xls文件导入到数据库中Jboss
- 18. 将.XLS文件数据导入到mySQL表
- 19. 导入文本文件 - Vb/Access
- 20. Powershell,导出xls文件
- 21. 如何将xls写入tmp文件夹
- 22. VBA将Excel文件保存为Access中的.xls
- 23. 将文本文件导入Windows 7中的Access数据库
- 24. 将Excel数据导入Access
- 25. 将MS ACCESS DB导入mySql?
- 26. 在Access中导入.sql文件
- 27. 将.xls/.csv导入iPhone应用程序
- 28. 将Excel文件导入Access VBA时更改数据类型
- 29. 使用Excel 2016将Excel文件导入Access
- 30. 将大量550000+行CSV文件导入Access
嗨。感谢上述所有。内存问题似乎是笔记本电脑无法应对的问题。这些文件是从Oracle数据库下载的系统,因此尚未由用户创建。但是,我使用访问来处理文件的问题似乎与文件是.xls的事实有关,并且访问表示它无法读取数据。 –