excel

reading worksheet and preserving conditional formatting

ε祈祈猫儿з 提交于 2021-02-18 07:23:24
问题 I am trying to read an excel worksheet with openpyxl. I think I am losing the conditional formatting information in the sheet when I read it like so: xl = openpyxl.load_workbook(filename) When I read all cells in the file and save it. I get a spreadsheet in which none of the conditional formatting is implement. I can find many ways of adding conditional formatting to a spreadsheet at http://openpyxl.readthedocs.org/en/latest/formatting.html But I cannot find a way to read conditional

Combine multiple csv files into a single xls workbook Python 3

两盒软妹~` 提交于 2021-02-18 06:49:10
问题 We are in the transition at work from python 2.7 to python 3.5. It's a company wide change and most of our current scripts were written in 2.7 and no additional libraries. I've taken advantage of the Anaconda distro we are using and have already change most of our scripts over using the 2to3 module or completely rewriting them. I am stuck on one piece of code though, which I did not write and the original author is not here. He also did not supply comments so I can only guess at the whole of

apache poi apply one style to different workbooks

戏子无情 提交于 2021-02-18 05:00:27
问题 I'm trying to apply one cell style to defferent woekbooks. It works well, when I apply it to first workbook, but when I'm trying to do this with second and next workbooks - no style is applied and the following exception is thrown. Exception in thread "Thread-3" java.lang.IllegalArgumentException: This Style does not belong to the supplied Workbook Stlyes Source. Are you trying to assign a style from one workbook to the cell of a differnt workbook? at org.apache.poi.xssf.usermodel

Excel Macro R1C1 formula not retaining values

无人久伴 提交于 2021-02-17 06:54:51
问题 I have an excel macro that creates a new excel sheet and fills it with a variable number of rows. I have a count of the number of rows stored in a variable. I'm using an R1C1 formula to multiply two cells together based on my row count. In the macro the formula looks like it's correct (if I add a break point and put a watch on it) but when the macro finishes the formula in the cell is incorrect. VB Code to generate formula: MainSheet.Cells(RowCount + 6, 6).FormulaR1C1 = "=R[" & RowCount + 3 &

Can't create Excel anymore after use of IIS

倖福魔咒の 提交于 2021-02-17 06:53:06
问题 I've created a web application that generates and allows the user to download an Excel file, It worked fine on the Visual Studio LocalHost. After I've launched it to the IIS server everything works just fine except the Generation of the excel file. The code died the first time that he is trying to select range in the work sheet - The error is the NULL error("Object reference...") I guess it kind of permission but I couldn't find one. Any Idea? Thanks. 回答1: As noted in comments use of Office

How to VBA wait for windows save dialogbox and sendkeys

▼魔方 西西 提交于 2021-02-17 06:50:09
问题 I'm creating a macro file that download and save extracted data from SAP old version 7.20 , when the save dialogbox is appear , the windows dialogbox is not detected since my client SAP version is old 7.20. now my resolution on this is the sendkeys but the problem is some of the data is containing large amount that getting unreliable time to send the keys. How to wait for the save dialogbox and when appear sendkeys. Sub test() waitTime (10000) Call SendKeys("{Enter}", True) End Sub Function

VBA cut-paste range of data

Deadly 提交于 2021-02-17 06:35:31
问题 I'm attempting to make a large amount of Genetic data, a little more legible in Excel using VBA. I am trying to cut and paste every 7 cells that have data, after the 15th column, and drop them down under columns 8-15. The example of what I need is in the picture included. DATA EXAMPLE (RAW vs What i need it to look like) As you can see by the code, the real data is a little bigger. (At 680 rows and over 100 columns.) When I try running the code, it is failing when it goes to paste the range

Excel VBA: ODBC SQL server driver query timeout expired

≯℡__Kan透↙ 提交于 2021-02-17 06:30:49
问题 I have the below VBA query used in Excel 2016 that exacutes a MS Sql stored procedure, sometimes it executes smoothly and returns the recordset, but more often I get an error [Microsoft][ODBC SQL Server Driver] query timeout expired . At the same time when we go to SSMS and execute the query it runs without issues. This assumes the issue is rather caused by Excel/VB than by SQL or the query itself. Searching for this error results in checking network firewalls, but we tried on other machines

Exporting data from Excel to Word: data targets/placeholders

℡╲_俬逩灬. 提交于 2021-02-17 06:16:51
问题 In Excel I have a userform that has a ListBox being populated from an Excel table using RowSource=myTable. Now I want to select one line, press a button, and export every column from the selected row to different places on a Word document, which is a template with pre-formated text. Column1 should go to place1, column2 to place2, whatever I want... What data targets/placeholders are available in Word for inserting data? 回答1: Word has multiple possibilities for the developer to write data that

Copy pasting multiple sheets into new workbook

為{幸葍}努か 提交于 2021-02-17 06:11:53
问题 The goal is to copy paste multiple existing sheets out of a workbook into a new workbook using xlwings. I have: app = xw.App(visible=False) book = xw.Book(path) sheet_1 = book.sheets["Sheet1"] sheet_2 = book.sheets["Sheet2"] wb_res = xw.Book() sheet_active = wb_res.sheets.active sheet_1.api.Copy(Before=sheet_active) This throws: TypeError: Objects for SAFEARRAYS must be sequences (of sequences), or a buffer object. Bonus question for the brave: - How can I replace all formulas on a sheet for