excel

Openpyxl corrupts xlsx on save. Even when no changes were made

。_饼干妹妹 提交于 2021-02-11 14:30:13
问题 TL;DR; Using Openpyxl to save changes to a large excel file results in a corrupted xlsx file The Excel file is made of several tabs with graphs, formulae, and images, and tables. Powershell script can save edits to the xlsx file with no issues. I can read the cell values from the excel file with Openpyxl, I am also able to edit & save the xlsx file manually. Excel file is unprotected. All errors and code snippets have been provided below. I'm unable to add data to an excel file that one of

Openpyxl corrupts xlsx on save. Even when no changes were made

牧云@^-^@ 提交于 2021-02-11 14:28:49
问题 TL;DR; Using Openpyxl to save changes to a large excel file results in a corrupted xlsx file The Excel file is made of several tabs with graphs, formulae, and images, and tables. Powershell script can save edits to the xlsx file with no issues. I can read the cell values from the excel file with Openpyxl, I am also able to edit & save the xlsx file manually. Excel file is unprotected. All errors and code snippets have been provided below. I'm unable to add data to an excel file that one of

SUMIFS in python jupyter

早过忘川 提交于 2021-02-11 14:25:16
问题 I have this dataframe. This is a transaction of exchange goods. So basically the client can switch into those goods which have the same quality or lower. So for Client 1 on 16/08/2019, 360 B grade goods switch into 180 B and 180 A goods. This needs to be flagged. I can do this in excel, however, the file is too big and it crashes. In/Out Client Quality Date GoodsAmount In 1 A 16/08/2019 180 In 1 B 16/08/2019 180 Out 1 B 16/08/2019 360 In 2 C 14/08/2019 130 Out 2 B 14/08/2019 45 Out 2 C 14/08

Use array as X axis and not having it show up as “Series 1”

十年热恋 提交于 2021-02-11 14:21:14
问题 I'm creating a line graph and I use a 2d array with three arrays in it. The first one contain dates and it's supposed to be the X axis, the next two is the data that should be shown as lines on the graph. Everything works as it should, except for one thing. On the side of the graph you see the names of three series, "Series1" (the dates), "Delivery speed" and "Delivery Average". I only want to show the names of the last two series not the first one. Is it possible to only use the first array

Use array as X axis and not having it show up as “Series 1”

放肆的年华 提交于 2021-02-11 14:20:06
问题 I'm creating a line graph and I use a 2d array with three arrays in it. The first one contain dates and it's supposed to be the X axis, the next two is the data that should be shown as lines on the graph. Everything works as it should, except for one thing. On the side of the graph you see the names of three series, "Series1" (the dates), "Delivery speed" and "Delivery Average". I only want to show the names of the last two series not the first one. Is it possible to only use the first array

MsgBox caused charts to appear as blank

旧街凉风 提交于 2021-02-11 14:15:09
问题 I have created code to fit a model to some data and then create a chart comparing measured/fitted data. I want to include a msgbox so that the user can check that the chart shows a decent fit and then OK it to continue. Even though the code for the msgbox is after the creation of the charts (right at the end of the sub), the charts are displayed as blank while the msgbox is shown. The charts display properly after either yes or no is selected in the msgbox. I have tried, pausing the sub for a

Copy the element throughout the whole workbook with exclusion some sheets

眉间皱痕 提交于 2021-02-11 14:15:06
问题 I would like to copy the element throughout the whole workbook, keeping one sheet excluded (the very 1st one). Following the query here: Copy the element throughout a whole workbook and the advice here: VBA - Loop Through All Sheets And Exclude One I prepared the code as per below: Sub asbuiltcopy() Dim Ws As Worksheet, ws1 As Worksheet, ws2 As Worksheet, s As Shape Set ws1 = Worksheets("Frontsheet") 'sheet containing original textbox Set ws2 = Worksheets("Readme") Set s = ws1.Shapes(

vba code for changing query xls source prompt

a 夏天 提交于 2021-02-11 14:13:39
问题 I was searching for a simple vba code that open the prompt for change source for query that is xls sheet. I have a lot of query steps that i need to do every time that source is changing. So basically i would like to have macro that does this manual steps for a certain query name (i have a number of them in a workbook): in the query edit mode, click the source change button:source macro should open the prompt so that i can manually pick the xls file:screen also, the data can be in a sheet

Search a range of word from a paragraph

帅比萌擦擦* 提交于 2021-02-11 14:01:32
问题 I have a list of word. i want to mark that word within a paragraph if match. if word match then want to change the color. I am trying this code: Sub HighlightStrings() Application.ScreenUpdating = False Dim rng As Range Dim InputRang As Range Dim cFnd As String Dim xTmp As String Dim x As Long Dim celValue As String Dim m As Long Dim y As Long Dim xFNum As Integer Dim xArrFnd As Variant Dim xStr As String celValue = Range("A1").Value cFnd = celValue If Len(cFnd) < 1 Then Exit Sub xArrFnd =

Rank & Rank.EQ function - Array reference error

丶灬走出姿态 提交于 2021-02-11 13:58:31
问题 Background: Short question on the use of array references within RANK or RANK.EQ function. Both function got the following parameters: ....(number,ref,[order]) Ms.Documentation about the Ref parameter within RANK and RANK.EQ : " Ref Required. An array of, or a reference to, a list of numbers. Nonnumeric values in ref are ignored." Also, other websites I would normally highly recommend, would state that the use of an array or list is possible within the Ref parameter. Sample data: | Rank1 |