excel

PHPSpreadsheet generates invalid file with charts

不羁岁月 提交于 2021-02-07 09:33:46
问题 I am migrating the existing/working app from PHPExcel ( phpoffice/phpexcel: 1.8.0 ) to PHPSpreadsheet and I have hit an issue when generating Excel file containing one or more charts . Without any addChart calls, the generated file is valid, but as soon as I add a chart, the resulting file becomes invalid. Excel does attempt to recover the data, which succeeds but without a chart. Excel recovery tool shows: Excel completed file level validation and repair. Some parts of this workbook may have

Attach multiple files to Outlook email from a filtered list and loop [closed]

£可爱£侵袭症+ 提交于 2021-02-07 09:33:21
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question I have a list of customers with their invoice data (one customer may have one or more than one rows of data). I have assembled a macro script from multiple codes to filter out the customer (basis on email address) and send them a dunning letter with their account statement. The

PHPSpreadsheet generates invalid file with charts

主宰稳场 提交于 2021-02-07 09:32:01
问题 I am migrating the existing/working app from PHPExcel ( phpoffice/phpexcel: 1.8.0 ) to PHPSpreadsheet and I have hit an issue when generating Excel file containing one or more charts . Without any addChart calls, the generated file is valid, but as soon as I add a chart, the resulting file becomes invalid. Excel does attempt to recover the data, which succeeds but without a chart. Excel recovery tool shows: Excel completed file level validation and repair. Some parts of this workbook may have

Row Looping in Excel

主宰稳场 提交于 2021-02-07 09:26:31
问题 How to loop a row in excel using c#? Looping like using datatable foreach(DataRow _dr in datatable.row) { //data } I'm trying and got this one. But it loops per column foreach (Excel.Range r in usedRange) { // check condition: try { if (Convert.ToInt32(r.Value2.ToString()) == 0) { // if match, delete and shift remaining cells up: r.Delete(Excel.XlDeleteShiftDirection.xlShiftUp); break; } } catch { } } 回答1: Further to my comments When you loop through a range, it always loops left to right and

Java Convert 'Excel Date Serial Number' to 'DateTime' [duplicate]

爱⌒轻易说出口 提交于 2021-02-07 09:26:28
问题 This question already has answers here : Converting number representing a date in Excel to a Java Date object (5 answers) Closed last month . How convert 'excel date serial number'(i.e. 33257.415972222225) to DateTime(i.e. 19/01/1991 09:59:00) using Java? 回答1: You can also have a look at the Source code of Apache POI, method DateUtils#getLocalDateTime(double date, boolean use1904windowing, boolean roundSeconds) . This utility class offers more handy methods for working with Excel dates. 回答2:

Workbooks.OpenText ignoring FieldInfo column parameter

元气小坏坏 提交于 2021-02-07 09:19:21
问题 I have the below line to import a csv format file. Workbooks.OpenText Filename:=sPath, DataType:=xlDelimited, Comma:=True, FieldInfo:=Array(Array(18, 5), Array(19, 5)), Local:=True From microsoft's documentation here, the FieldInfo doesn't have to be in any order if it is in delimited. The column specifiers can be in any order. If there's no column specifier for a particular column in the input data, the column is parsed with the General setting. However excel seems to treat the first array

Workbooks.OpenText ignoring FieldInfo column parameter

时间秒杀一切 提交于 2021-02-07 09:17:01
问题 I have the below line to import a csv format file. Workbooks.OpenText Filename:=sPath, DataType:=xlDelimited, Comma:=True, FieldInfo:=Array(Array(18, 5), Array(19, 5)), Local:=True From microsoft's documentation here, the FieldInfo doesn't have to be in any order if it is in delimited. The column specifiers can be in any order. If there's no column specifier for a particular column in the input data, the column is parsed with the General setting. However excel seems to treat the first array

Excel VBA Conditional Formatting not executing

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 09:16:07
问题 This is odd. I'm creating an Excel 2003 spreadsheet from MS Access 2003 VBA, and the coding includes conditional formatting: if the cell value is greater than [a value] it's colored red if it's less than [a value], it's colored green. Even though the CF formulas are created successfully when the spreadsheet is generated, all the colors are green, regardless of the value. If I manually type the original value into a cell, it will trigger then CF and it appears correctly, but otherwise it just

Remove a worksheet in Excel using r package xlsx

陌路散爱 提交于 2021-02-07 09:15:23
问题 As the title stated, I would like to delete the second worksheet in excel using r with package xlsx. However, after running the code, nothing happened. Following is a sample code I used to delete the sheet: path = "C://ECOS//Code//Test//data.xlsx" sheets = getSheets(loadWorkbook(path)) removeSheet(loadWorkbook(path), sheetName = names(sheets[2])) Really appreciate helps. Thank you! 回答1: You need to save the workbook in the same file (or different if you prefer). wb = loadWorkbook(path)

Excel VBA Conditional Formatting not executing

走远了吗. 提交于 2021-02-07 09:14:29
问题 This is odd. I'm creating an Excel 2003 spreadsheet from MS Access 2003 VBA, and the coding includes conditional formatting: if the cell value is greater than [a value] it's colored red if it's less than [a value], it's colored green. Even though the CF formulas are created successfully when the spreadsheet is generated, all the colors are green, regardless of the value. If I manually type the original value into a cell, it will trigger then CF and it appears correctly, but otherwise it just