Thank you Roy - any thoughts on what precisely can be causing GdiPlus.dll
Posts by dorian777
-
-
I will note that the loop with image generator disabled still resulted in the same crash...I wonder if there is any tool which can track vba steps which CAUSE CRASHES?
-
Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why
nothing works and they don’t know whynice moto - hopefully someone can help
-
I will do a test run without saving any images.....if it does not crash when it must be this image macro...
-
this is an alternative macro to generate images form camera images?
let me show you the code I am using:
camera image exporter to png:
Code
Display MoreSub biy_comara() Dim spath As String Dim rrng As Object, sht As Object Set sht = ThisWorkbook.Worksheets("chart") spath = ThisWorkbook.Path & "\exported\" & sht.Range("ao1").Value & ".png" Set rrng = ActiveSheet.Range("A2:aj102") Application.CutCopyMode = False Application.Wait Now + TimeValue("0:00:02") On Error Resume Next rrng.CopyPicture appearance:=xlScreen, Format:=xlPicture Application.Wait Now + TimeValue("0:00:02") On Error Resume Next With rrng.Parent.ChartObjects.Add(30, 30, 400, 400) .ShapeRange.Line.Visible = msoFalse .Height = rrng.Height .Width = rrng.Width .Chart.Paste .Chart.export Filename:=spath, filtername:="png" .Delete End With End Sub
the macro to adjust multiple overlaying excel charts
Code
Display MoreSub AdjustVerticalAxis() 'PURPOSE: Adjust Y-Axis according to Min/Max of Chart Data 'SOURCE: www.TheSpreadsheetGuru.com Dim cht As ChartObject Dim Srs As Series Dim FirstTime As Boolean Dim MaxNumber As Double Dim MinNumber As Double Dim MaxChartNumber As Double Dim MinChartNumber As Double Dim Padding As Double selecttab Calculate 'Input Padding on Top of Min/Max Numbers (Percentage) Padding = 0 'Number between 0-1 'Optimize Code Application.ScreenUpdating = False 'Loop Through Each Chart On ActiveSheet For Each cht In ActiveSheet.ChartObjects Select Case LCase$(cht.Name) Case "rsi", "stoch", "bbwidth" ' skip Case Else 'First Time Looking at This Chart? FirstTime = True 'Determine Chart's Overall Max/Min From Connected Data Source For Each Srs In cht.Chart.SeriesCollection 'Determine Maximum value in Series MaxChartNumber = ActiveWorkbook.Sheets("HLEXA").Range("e2").Value 'Determine Minimum value in Series (exclude zeroes) MinChartNumber = ActiveWorkbook.Sheets("HLEXA").Range("e1").Value 'First Time Looking at This Chart? FirstTime = False Next Srs 'Rescale Y-Axis cht.Chart.Axes(xlValue).MinimumScale = MinChartNumber * (1 - Padding) cht.Chart.Axes(xlValue).MaximumScale = MaxChartNumber * (1 + Padding) End Select Next cht SetWeights Colors scroll 'Optimize Code Application.ScreenUpdating = True export End Sub
macro to loop through the calculating workbook:
Code
Display MoreSub AGGREGATE() Dim WorkingSht As Worksheet, i As Long, j As Long, k As Long, n As Long, newSht As Worksheet, DestnRow As Long Dim SourceRng As Range, SourceWidth As Long, SourceHeight As Long, GapBetweenResults As Long Windows("daily data macro.xlsm").Activate Sheets("data").Select Set WorkingSht = ActiveSheet 'Set newSht = Sheets.Add(after:=Sheets(Sheets.Count)) Set newSht = Sheets("RESULTS") 'newSht.Range("A:AD").ClearContents GapBetweenResults = 0 'adjust to change the gap between results blocks. DestnRow = 1 With WorkingSht .Activate 'optional Set SourceRng = Worksheets("data").Range("AI32:FB32") SourceWidth = SourceRng.Columns.Count SourceHeight = SourceRng.Rows.Count GapBetweenResults = SourceHeight + GapBetweenResults Worksheets("data").Activate Started 'save started text For i = 1 To 179 Worksheets("data").Activate .Range("AI1") = i ' For j = 0 To 0 ' .Range("A5000") = j ' For k = 0 To 0 ' .Range("B5000") = k ' For n = 0 To 0 ' .Range("A1") = n 'do your result grabbing here: 'Calculate generate_chart ' newSht.Cells(DestnRow, 1).Resize(SourceHeight, SourceWidth).Value = SourceRng.Value DestnRow = DestnRow + GapBetweenResults ' ' Next n ' Next k ' Next j Application.StatusBar = i Next i Windows("daily data macro.xlsm").Activate ActiveWorkbook.Save CloseAll 'MsgBox "Aggregation Complete" purplescreen End With End Sub
I have another calculation having workbook opened separately it never crashes - therefore I am concluding this can be related to image handling when saving camera images (GdiPlus.dll appears to be related to image handling)...maybe I can just save the whole cell range (which has multiple overlaid images) - without using the camera?
-
it does not have answers anywhere as this is apparently insolvable problem.
-
[xpost][/xpost]
Hello,
Excel crashes randomly showing GdiPlus.dll as the reason - when running a loop which saves the camera image as the multiple different png files. Do you think this error can be related to how the macro is taking the image from the camera image and saving it?
Here is the error message:CodeProblem signature: Problem Event Name: APPCRASH Application Name: EXCEL.EXE Application Version: 14.0.7229.5000 Application Timestamp: 5c46583d Fault Module Name: GdiPlus.dll Fault Module Version: 6.1.7601.17514 Fault Module Timestamp: 4ce7b714 Exception Code: c0000005 Exception Offset: 000b06db OS Version: 6.1.7601.2.1.0.768.2 Locale ID: 1033 Additional information about the problem: LCID: 1033 skulcid: 103
-
anyone can please help? rather urgent issue...
-
[xpost][/xpost]
Hello I am using this code to save the worksheet range as the png file..... I am usually able to generate up to 50 images (or 35) 0 doing loop through the data - but then it just gives the above error - VBA Error 1004 - CopyPicture method of Range class failed
Code
Display MoreOption Explicit Sub biy_comara() Dim spath As String Dim rrng As Object, sht As Object Set sht = ThisWorkbook.Worksheets("chart") spath = ThisWorkbook.Path & "\" & sht.Range("ao1").Value & ".png" Set rrng = ActiveSheet.Range("A2:aj102") rrng.CopyPicture appearance:=xlScreen, Format:=xlPicture With rrng.Parent.ChartObjects.Add(30, 30, 400, 400) .ShapeRange.Line.Visible = msoFalse .Height = rrng.Height .Width = rrng.Width .Chart.Paste .Chart.export Filename:=spath, filtername:="png" .Delete End With End Sub
I wonder if anyone can help me with this? thanks a lot!)
-
I understand the color should be set with RGB values? Maybe someone can help...this is thread more like talking to myself topic:))
-
was able to make it work - here is for everyone to use - very handy scrip...
Now I need to set the color of each line based on similar row of integers - 1 (for red), 2 (for blue)
please help me modify the macro:
-
I found this code from here
https://stackoverflow.com/questions/3243…hts-with-a-loop
I have trouble understanding when the weight range should match the line range?
CodeSub SetWeights() Dim Srs As Series Dim myWeight As Range Dim £w As Range Dim j As Long Set myWeight = Range("Weights") j = 1 With ActiveSheet For Each £w In myWeight If j > ActiveChart.SeriesCollection.Count Then Exit Sub ActiveChart.SeriesCollection(j).Format.Line.Weight = £w j = j + 1 Next £w End With End Sub
-
thank you for the help Roy. I have attached the line chart with the data and the upper column values which have the line width in pts - currently line width is 2.25 pts for all line charts on the graphs. I need to adjust the line width for 4 lines by taking the values in the upper row:
Width1 Width2 Width3 Width4 0.5 1 1.5 2 Series1 Series2 Series3 Series4 23 70 98 98 24 68 101 103 25 66 104 108 26 64 107 113 27 62 110 118 28 60 113 123 29 58 116 128 30 56 119 133 31 54 122 138 32 52 125 143 33 50 128 148 34 48 131 153 35 46 134 158 36 44 137 163 37 42 140 168 38 40 143 173 39 38 146 178 40 36 149 183 41 34 152 188 42 32 155 193 43 30 158 198 44 28 161 203 45 26 164 208 46 24 167 213 47 22 170 218 -
-
this is beyond ecxel or vba?
-
Hello,
I have a simple line chart and woudl want to change line color saturation based on a single cell value for each of the lines in the chart. Can this be done in VBA? I also need to change line thickness based on a single cell value for each line . I am using office 2010...
Any help is gladly accepted)
David
-
IT TURNED OUT the running maximum formula was operating on 20 billion cells at one iteration - the solution was just running the high water mark when it changes - not calculating maximum on all previous cells - now in stead of 20 billion claucltotions the PC has to perform only 250 k - fabulous!
-
In essense I need to find HOW STRAIGHT A LINE IS - now matter the slope....can it be done with the simple linest or intercept formulas? I woudl need to create a line and then compare the original curev to this line to see hwo far it digresses from the estimated line - is there a formula for this?
-
I think I have run into excel limitations at last. My 32-core PC is finding it hard to calculate the running sum on a 250000 row column and I need to test
a few parameters which will lead to different values in this column. This running sum is used to create the account trading curve - find maximums on this curve and then subtract and subsequent data point from this maximum to get the drawdown. Now my pc refuses to create this curve due to overload.
I wonder if there is an alternative way to calculate maximum drawdown on a trading curve?
For this I need to find the maximum value of the difference between the earlier peak and the active point divided by the peak. Can this be done in a single formula?
here are some sample data points.
-18.5 -28.5 71.5 61.5 51.5 41.5 31.5 31.5 21.5 11.5 1.5 -8.5 -18.5 -28.5 -38.5 -48.5 -58.5 41.5 31.5 21.5 11.5 111.5 101.5 91.5 81.5 181.5 171.5 161.5 151.5 141.5 131.5 121.5 111.5 101.5 91.5 81.5 81.5 71.5 61.5 51.5 41.5 31.5 21.5 11.5 1.5 -8.5 91.5 81.5 71.5 61.5 161.5 151.5 141.5 131.5 231.5 221.5 211.5 201.5 191.5 181.5 171.5 161.5 151.5 141.5 131.5 131.5 121.5 111.5 101.5 91.5 81.5 71.5 61.5 51.5 41.5 141.5 131.5 121.5 111.5 211.5 311.5 411.5 401.5 501.5 491.5 481.5 471.5 461.5 451.5 441.5 431.5 421.5 411.5 401.5 401.5 391.5 381.5 371.5 361.5 351.5 341.5 331.5 321.5 311.5 301.5 291.5 281.5 271.5 261.5 251.5 241.5 341.5 331.5 321.5 311.5 301.5 291.5 281.5 381.5 371.5 361.5 351.5 341.5 341.5 331.5 321.5 311.5 411.5 401.5 501.5 491.5 481.5 471.5 461.5 451.5 441.5 431.5 421.5 411.5 401.5 391.5 381.5 371.5 361.5 351.5 341.5 331.5 431.5 421.5 411.5 401.5 391.5 391.5 381.5 371.5 361.5 461.5 451.5 441.5 431.5 421.5 411.5 401.5 391.5 491.5 481.5 471.5 461.5 451.5 441.5 431.5 531.5 521.5 511.5 501.5 491.5 591.5 581.5 571.5 561.5 551.5 551.5 541.5 531.5 521.5 621.5 611.5 601.5 591.5 581.5 571.5 561.5 551.5 541.5 531.5 631.5 621.5 611.5 601.5 701.5 -
You can add an InputBox asking the user to the select the Range or type the range in a cell, but I would never use that method.
How is the range changing?
Thank you Roy - the range will be chanign dynamically from 28 to 1 rows (16000 columns per row)....I will generate range dimensions via formula and place then into a cell.....this can be used as dynamic range?