xls

jxl读取excel文件异常:Unable to recognize OLE stream 的解决方法

匿名 (未验证) 提交于 2019-12-03 00:15:02
问题成因 使用jxl方式读取,可能只能支持xls格式的文件,对于xlsx格式就不再支持 如果是从网站导出的excel文件,有的网站比较坑,导出的并不是标准格式的excel,而是将html改扩展名为xls的“伪”excel文件。当用excel打开这类文件时,会弹窗提示其“扩展名和文件类型不匹配”是否还要打开。 而且,使用文本编辑器打开,会发现这个所谓xls文件其实是xml标签的文件。 在excel中打开,另存成xls就可以。 vba批量另存 。 第一种情况直接用vba批量另存即可,但第二种略有麻烦,因为会有报错弹窗,vba运行时会报错。 下面以第二种情况为例详细说明解决步骤。 首先,需要 禁止excel的报错弹窗 ,否则使用vba批量另存时会出错。方法如下: 1 1、开始 -> 运行 -> 输入regedit -> 确定 2 2、找到注册表子项 3 4 HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security 5 6 3、在右侧空白处点击鼠标右键,选择“新建 -> DWORD值(D)”,输入"ExtensionHardening"点击确定。 7 4、用鼠标右键点击ExtensionHardening,然后单击“修改(M)”,在数值数据中填写"0"即可确定。 8 5、关闭注册表编辑器

Delphi - cxGrid内容xlsx/.xls /.csv格式导出

匿名 (未验证) 提交于 2019-12-02 23:55:01
.xls格式导出,uses中添加cxGridExportLink 代码如下: 1 function SaveToExcel ( gridMain : TcxGrid ; FileName : string ): string ; 2 var 3 SaveFileDialog : TSaveDialog ; 4 begin 5 //示例:SaveToExcel(dxDBGrid1,'默认文件名'); 6 SaveFileDialog := TSaveDialog . Create ( nil ); 7 SaveFileDialog . FileName := FileName ; 8 SaveFileDialog . Filter := '*.xls' ; 9 if SaveFileDialog . Execute then 10 begin 11 if pos ( '.XLS' , UpperCase ( SaveFileDialog . FileName )) <= 0 then 12 SaveFileDialog . FileName := SaveFileDialog . FileName + '.XLS' ; 13 ExportGridToExcel ( SaveFileDialog . FileName , gridMain ); 14 ShowMessage (

Getting extension check(hardening) alert while opening a .xls file using Office 2007/2010

跟風遠走 提交于 2019-12-02 21:33:31
问题 I am working on a struts based web application. In that application, we generate and download xls file from Jsp. In Jsp file and web.xml, I have set the content-type as "application/vnd.ms-excel" it seems xls files generated by the jsp pages are not real excel files, but a text format that is understood by the MS Excel. Hence excel opens the files and displays the output similar to excel files saved by MS Excel. Since newer versions of MS Office 2007/2010 checks the file extension and the

Spire.xls excel xls 修改打印设置 页边距 页眉页脚高度

与世无争的帅哥 提交于 2019-12-02 13:23:22
Workbook workbook = new Workbook(); workbook.LoadFromFile(@"卷内目录.xls"); Worksheet sheet = workbook.Worksheets[0]; sheet.PageSetup.HeaderMarginInch = 0;//页眉高度 sheet.PageSetup.FooterMarginInch = 0;//页脚高度 sheet.PageSetup.TopMargin = 0.786805555555556;//不是像素,这个值=2 sheet.PageSetup.LeftMargin= 0.984027777777778;//这个值=2.5 sheet.PageSetup.BottomMargin = 0.786805555555556;//这个值=2 sheet.PageSetup.RightMargin = 0.786805555555556;//这个值=2 workbook.Save(); x 1 2 Workbook workbook = new Workbook(); 3 workbook.LoadFromFile(@"卷内目录.xls"); 4 5 Worksheet sheet = workbook.Worksheets[0]; 6 sheet.PageSetup

Getting extension check(hardening) alert while opening a .xls file using Office 2007/2010

不羁岁月 提交于 2019-12-02 11:52:00
I am working on a struts based web application. In that application, we generate and download xls file from Jsp. In Jsp file and web.xml, I have set the content-type as "application/vnd.ms-excel" it seems xls files generated by the jsp pages are not real excel files, but a text format that is understood by the MS Excel. Hence excel opens the files and displays the output similar to excel files saved by MS Excel. Since newer versions of MS Office 2007/2010 checks the file extension and the content inside the file, they issue a warning that the file format does not match with the content. To get

How to obtain the data from cell from 500 .xls Excel files?

五迷三道 提交于 2019-12-02 10:02:13
I'd like to ask you how can I get the data from few determined (and always same) cells from many Excel .xls files, I.e. I have a list of .xls files in one folder, and each file has the same table inside, but with the different values. I would like to obtain the data from A1 , C2 , E3 from all files in folder and put them together into a new table in the new Excel file. Is there a way how to do it, please? :) Thanks! ;) I retrieve external data as follows: Create a worksheet called "x" that specifies the following info for each item of data I want to get: So I have the folder name, the file

Read a value from a .xls file using .bat files

て烟熏妆下的殇ゞ 提交于 2019-12-02 06:55:36
I just want to know if there could be any way by which we can read a value from an .xls file using a .bat file. For eg:If i have an .xls named test.xls which is having two columns namely 'EID' and then 'mail ID'.Now when we give the input to the .xls the EID name.it should extract the mail id which corresponds to the EID and echo the result out. **EID** **MailID** E22222 MynameisA@company.com E33333 MynameisB@company.com ... ... So by the above table,when i give the input to the xls file using my .bat file as E22222,it should read the corresponding mail ID as MynameisA@company.com and it

jxl读取excel文件异常:Unable to recognize OLE stream 的解决方法

若如初见. 提交于 2019-12-02 04:40:47
问题成因 使用jxl方式读取,可能只能支持xls格式的文件,对于xlsx格式就不再支持 如果是从网站导出的excel文件,有的网站比较坑,导出的并不是标准格式的excel,而是将html改扩展名为xls的“伪”excel文件。当用excel打开这类文件时,会弹窗提示其“扩展名和文件类型不匹配”是否还要打开。 而且,使用文本编辑器打开,会发现这个所谓xls文件其实是xml标签的文件。 解决方法 在excel中打开,另存成xls就可以。 但当文件比较多时,可以使用excel vba批量另存 。 第一种情况直接用vba批量另存即可,但第二种略有麻烦,因为会有报错弹窗,vba运行时会报错。 下面以第二种情况为例详细说明解决步骤。 首先,需要 禁止excel的报错弹窗 ,否则使用vba批量另存时会出错。方法如下: 1 1、开始 -> 运行 -> 输入regedit -> 确定 2 2、找到注册表子项 3 4 HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security 5 6 3、在右侧空白处点击鼠标右键,选择“新建 -> DWORD值(D)”,输入"ExtensionHardening"点击确定。 7 4、用鼠标右键点击ExtensionHardening,然后单击“修改(M)”,在数值数据中填写"0"即可确定。 8 5

convert xml to xls

五迷三道 提交于 2019-12-02 04:03:41
I'm looking for ideas on how to implement a way to get web based XML data into a spreadsheet. The ideal solution would update the spreadsheet every time it's opened with little or no user interaction (.i.e, I'd prefer to not have to tell people to run a macro). however, my first thought (and probably what I'll end up going with) is a Perl script that downloads the XML, parses it, and spits out a spreadsheet - this won't update the spreadsheet and I'll have to generate the document on some type of schedule (yes, i prefer complete automation and coding myself out of jobs :) ). what i (think i)

Classic ASP XLS output with carriage return in cell

…衆ロ難τιáo~ 提交于 2019-12-02 01:57:06
I have a Classic ASP script that outputs an HTML table as an XLS file but have had no luck getting a carriage return/line feed to work within a single cell. For testing I am using code based on Kristof's response to How to output an Excel *.xls file from classic ASP I've tried every method I know of for inserting a carriage return/line feed. My sample code is as follows: <%@ Language=VBScript %> <% Option Explicit Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "attachment; filename=excelTest.xls" %> <table border="1"> <tr> <td>Line1<br />Line2</td>