VBA Exporting Chart Arrays on Button Click -
sub onButtonClick () goal in as dim source worksheet, worksheet set source = Carypustkon ( "End Market Monitor. Xlsm "). Worksheets ( "Arrow graph") set in as dim Taitl_nam string as target = Sheet1 dim Vrksshit, Search As String search = ActiveCell.Offset (0, -5). Value Redem ChartArere (1 source. ChartObjects.Count) for chart as I = 1 source. Chart object Title Title_name = source.ChartObjects (i) .chart.ChartTitle.Text counter = 1 if InStr (title_name, search)> 0 Set the chart chart (counter) = source.ChartObjects (i). Close Counter = Counter + 1 Termination if Next Set wsTemp = Sheets For n = 1 with WsTemp for n = 1 (Chartarray) chartArray (n). Copy Image WsTemp.Range ("A1"). Paste Special Selection Empty = TP selection. Lift = 5 TP = TP + Selection. White + 50 wsTemp.ExportAsFixedFormat type with the next expiration = XlTypePDF, filename = NewFileName, quality = XlQualityStandard, _IncludeDocProperties = true ignore Krenprintares: = False, OpenAfterPublish: = True End Sub
I am having problems with the search variable. I am getting an object defined error and I do not know why ... do I have cell Should use office?
Also, when I am unable to use the loop, I'll loop through the array of chart do so I had to loop the upper bound of the range from 1. Is it viable?
item set is error pop up as ActiveCell.Offset (0, -5 )
Trying to select a cell that does not exist. If actively the column is in A, B, C, D or E, it will show this error because there is no column before A. Perhaps more specific then "Skriysel"
For looping through the chart, should do the following:
Chartobject as dart Chartobjed. For every chart object in the source .... Chart Object .... Next ChartObz
Comments
Post a Comment