willspill
01-21-2020, 02:49 AM
I am trying to save a chart out of excel with a file name of the format 'run-001_plot-001.png'. The following code works correctly apart from the fact that the programme is auto deleting the leading zeroes from 'Format(j,000)' to 'Format(j,0):
ActiveSheet.ChartObjects(1).Chart.Export filename:=output_directory & "\" & "run-" & Format(j, 0) & "_" & file_name & "." & output_file_type
.Shapes(MyChart).Delete
I read something explaining that it was due to the file being written rather than read but didn't fully understand it. Any ideas?
ActiveSheet.ChartObjects(1).Chart.Export filename:=output_directory & "\" & "run-" & Format(j, 0) & "_" & file_name & "." & output_file_type
.Shapes(MyChart).Delete
I read something explaining that it was due to the file being written rather than read but didn't fully understand it. Any ideas?