L
Legacy 317540
Guest
Hi,
I have a problem with creating charts in vba excel, spent last two days trying to figure it out.
The problem occurs when I'm trying to specify source data, which are in another excel file.
Part of the code:
Dim objWorkbook As Workbook
Dim objChart As Chart
Set objWorkbook = Workbooks.Open("file path")
Set objChart = Charts.Add
objChart.SetSourceData Source:=objWorkbook.Sheets("name of the sheet").Range("B9:E16")
I encouter mismatch error. I would be very grateful for any help with that.
I have a problem with creating charts in vba excel, spent last two days trying to figure it out.
The problem occurs when I'm trying to specify source data, which are in another excel file.
Part of the code:
Dim objWorkbook As Workbook
Dim objChart As Chart
Set objWorkbook = Workbooks.Open("file path")
Set objChart = Charts.Add
objChart.SetSourceData Source:=objWorkbook.Sheets("name of the sheet").Range("B9:E16")
I encouter mismatch error. I would be very grateful for any help with that.