xlsm

Error while reading an xlsm file using POI Framework in Java

半世苍凉 提交于 2019-12-21 02:55:45
问题 I am not able to read an xlsm file using the POI Framework (HSSF). I am getting the following error while reading an xlsm file. The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF) I tried reading the file through XSSF also. Even that doesn't solve the problem. Can anyone tell me how to read a xlsm file in java code using the poi

How to convert .xlsm (macro enabled excel file) to .xlsx using Python?

我的梦境 提交于 2019-12-19 03:35:22
问题 I am trying to import data in an .xlsm file as a data frame. When I import the .xlsm file using the command below, it gives me an empty data frames as the result: exp = pd.read_excel(File_Path+'file_name'.xlsx',sheetname='Data',header=None) I have manually saved .xlsm files as .xlsx file and imported them as data frame. Can anybody tell me how to save as .xlsm file as .xlsx using Python? 回答1: I would suggest you try using a win32com type approach. If you are on Windows, you can use Python to

Convert XLSM to XLSX

ε祈祈猫儿з 提交于 2019-12-18 06:57:30
问题 I'm using the EPPLUS library to read data from Excel to create another file. Unfortunately it does not support the .XLSM extension file. Is there a nice way to convert .XLSM files to .XLSX file for the purpose of reading the file with EPPLUS? (using EPPLUS for reading would be nice because all my code is already written using it :) ) 回答1: In order to do this you will need to use the Open XML SDK 2.0. Below is a snippet of code that worked for me when I tried it: byte[] byteArray = File

“Compile error: Method or data member not found” with previously working code

蹲街弑〆低调 提交于 2019-12-13 04:25:10
问题 As the title suggests, I'm getting the above error with code that was working 6 days ago. Code since omitted - apologies DurationCombo is an ActiveX ComboBox which resides on Sheet1. I can provide an image of the ComboBox: http://i.stack.imgur.com/eM7YD.png I've seen all of the information regarding the Microsoft Updates and removed the anomaly yet this problem has since returned. EDIT: I am also unable to add ActiveX controls to any Excel workbook. Bizarre, this one is! EDIT 2: It may be an

Way to convert from .xls to .xlsm via a batch file or vba?

孤街浪徒 提交于 2019-12-13 03:51:40
问题 How to I automate the conversion of .xls workbooks to .xlsm? 回答1: You can try this code: Sub TrandformAllXLSFilesToXLSM() Dim myPath As String myPath = "C:\Excel\" WorkFile = Dir(myPath & "*.xls") Do While WorkFile <> "" If Right(WorkFile, 4) <> "xlsm" Then Workbooks.Open FileName:=myPath & WorkFile ActiveWorkbook.SaveAs FileName:= _ myPath & WorkFile & "m", FileFormat:= _ xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False ActiveWorkbook.Close End If WorkFile = Dir() Loop End Sub See this

vba: saveas in xlsm fileformat without changing the active workbook

夙愿已清 提交于 2019-12-11 21:05:13
问题 I have the following code which makes copies of the active workbook and gives each copy a different name. It works well, BUT I really need the original worksheet from which the code is run to stay active. If I use the SaveCopyAs function instead, the copied files do not have the correct file format (.xlsm), and you cannot specify the file format as a parameter as in the saveAs function. http://msdn.microsoft.com/en-us/library/bb178003%28v=office.12%29.aspx http://msdn.microsoft.com/en-us

Force Excel to run macro using SQL Query

僤鯓⒐⒋嵵緔 提交于 2019-12-11 16:56:17
问题 I have a requirement to run the Excel file (either .xls or .xlsm) which has macros in it and it reduces the size of the other excel file and save it as different file in same folder. It works fine when I open the file manually from the folder, it runs immediately and creates the shrinked file. But the requirement is to open the Excel from SQL query and run it. I am trying to do it with these two ways in my SQL query. (1) EXEC [master].dbo.xp_cmdshell 'c:\temp\MyExcelShrink.xls' (2) EXEC xp

Convert any xls-xlsm files to Google Sheet format and overwrite the oldest existing GS file with that name

时间秒杀一切 提交于 2019-12-11 15:19:33
问题 I decided to open this topic because there is very little material in this regard and in my opinion many are asking the same question. I'm trying to write an script to convert an .xls or a .xlsm file stored on Google Drive to a Google Sheets file. I'm not interested in converting macros inside the .xlsm file, only converting the base file. This script should be able to overwrite the oldest file with the new one if it has the same name. The topics in which I found more material are these: How

Poi: Saving an excel file as xlsx after opening it from xlsm

不羁岁月 提交于 2019-12-11 07:54:44
问题 I'm writing a java program that opens a user-defined excel file, fills it with data, and then saves it under a user-specified path, file name and extension. It should be, but isn't, possible to declare the output to be saved as xlsx, even though the input file was xlsm. If I try that with the code as below, opening the file gives me the error: The file 'FileName.xlsx' is a macro-free file, but contains macro-enabled content Key segments of code: Opening the workbook: try (Workbook workbook =

PHPExcel XLSM file with macros

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 16:16:46
问题 Is it possible to read and write xlsm with macros file with phpexcel? I tested this code just to replicate the original file: $objReader = PHPExcel_IOFactory::createReader('Excel2007'); $objPHPExcel = $objReader->load("file1.xlsm"); echo ('Saving...'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('test.xlsm'); header('Cache-Control: max-age=0'); But the new file is different from the original because he has no images. Thank you. 回答1: PHPExcel