我必须编写一些VBA来导入大约100个.XLS文件 我可以轻松地做到这一点,但这些不是真正的 XLS。我认为它们是由Cognos Impromptu(或任何旧工具)生成的。当我用编辑器查看它们时,这是标题:
MIME-Version: 1.0
X-Document-Type: Workbook
Content-Type: multipart/related; boundary="----=_NextPart_01C3B8B1.6DB8B6D0"
This document is formatted for viewing in Microsoft Excel 2002 and subsequent versions. You are using a previous version of Excel.
------=_NextPart_01C3B8B1.6DB8B6D0
Content-Location: file:///C:/CE594991/xls.htm
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="us-ascii"
<html xmlns:v=3D"urn:schemas-microsoft-com:vml"
xmlns:o=3D"urn:schemas-microsoft-com:office:office"
xmlns:x=3D"urn:schemas-microsoft-com:office:excel"
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta name=3D"Excel Workbook Frameset">
<link rel=3DFile-List href=3D"xls_files/filelist.xml">
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dwindows-12=
52">
<meta nam
e=3DGenerator content=3D"Microsoft Excel 9">
我甚至无法在Access中手动链接这些 当我尝试在Excel中打开它们时,Excel会抱怨它们具有错误的扩展名,但随后会完美地打开它们。
从Access VBA读取这些技术的任何线索?
对于原型我有好的&#34; XLS文件和我正在使用像这样的查询来读取它们(超快速方法):
SELECT sh.field1, sh.field2, sh.fiel5
FROM [List_Frame$] AS sh IN '' [Excel 12.0;HDR=YES;IMEX=2;ACCDB=YES;DATABASE=\\myServer\someFolder\xxx_Fund_Details_20170906.xlsb];