Mihai Dulca
New Member
I am trying to set some additional parameters when filling the 3D columns in a 3D chart in Excel 2010 with JPG images. I can use the full file name (PictureFile parameter), but as soon as I add one of the optional parameters, e.g. PictureFormat the method fails with run-time error 450 (wrong number of arguments or invalid property assignment). Any advice?
With ch3DCS
.ChartType = xl3DColumn
' Generate series from the desired input range
For jSeries = 2 To rgDataIn.Rows.Count
.SeriesCollection.NewSeries ' Create data series
With .SeriesCollection(jSeries - 1) ' Fill in name, x-axis data, series value data and format points
.Name = rgDataIn.Cells(jSeries, 1)
.Values = Range(rgDataIn.Cells(jSeries, 2), rgDataIn.Cells(jSeries, rgDataIn.Columns.Count))
.XValues = Range(rgDataIn.Cells(1, 2), rgDataIn.Cells(1, rgDataIn.Columns.Count))
End With ' Series
Next jSeries
' Fill columns with the file content
For jSeries = 2 To rgDataIn.Rows.Count
With .SeriesCollection(jSeries - 1) ' Fill in name, x-axis data, series value data and format points
Select Case jSeries Mod 2
Case 0
stgFileName = stgRoot & "0.jpg"
Case 1
stgFileName = stgRoot & "1.jpg"
End Select
.Format.Fill.Visible = msoTrue
.Format.Fill.UserPicture stgFileName, xlStretch, , xlFrontSides
End With ' Series
Next jSeries
End With
I also tried to specify the parameters e.g. PictureFormat: = xlStretch, but then I got run-time error 448 (named argument not found). Using the value of the xl constant, 5, instead of the name did not change anything.
With ch3DCS
.ChartType = xl3DColumn
' Generate series from the desired input range
For jSeries = 2 To rgDataIn.Rows.Count
.SeriesCollection.NewSeries ' Create data series
With .SeriesCollection(jSeries - 1) ' Fill in name, x-axis data, series value data and format points
.Name = rgDataIn.Cells(jSeries, 1)
.Values = Range(rgDataIn.Cells(jSeries, 2), rgDataIn.Cells(jSeries, rgDataIn.Columns.Count))
.XValues = Range(rgDataIn.Cells(1, 2), rgDataIn.Cells(1, rgDataIn.Columns.Count))
End With ' Series
Next jSeries
' Fill columns with the file content
For jSeries = 2 To rgDataIn.Rows.Count
With .SeriesCollection(jSeries - 1) ' Fill in name, x-axis data, series value data and format points
Select Case jSeries Mod 2
Case 0
stgFileName = stgRoot & "0.jpg"
Case 1
stgFileName = stgRoot & "1.jpg"
End Select
.Format.Fill.Visible = msoTrue
.Format.Fill.UserPicture stgFileName, xlStretch, , xlFrontSides
End With ' Series
Next jSeries
End With
I also tried to specify the parameters e.g. PictureFormat: = xlStretch, but then I got run-time error 448 (named argument not found). Using the value of the xl constant, 5, instead of the name did not change anything.