logius
New member
- Aug 23, 2001
- 13
I'm trying to write a VBA macro that will, when given a CSV format file, take the appropriate data and create a graph. The problem I'm running into is that when I run a particular section:
I get the error
"Run-time error 1004: Method 'Range' of object '_Global' failed"
The strange part is that the macro will generate the graph anyway (after I select END from the popup). Any ideas as to why I get this error?
Code:
Sub CreateGraphE4()
Range(Range("E4"), ActiveCell.SpecialCells(xlCellTypeConstants, xlNumbers)).Select
ActiveWindow.ScrollColumn = 1
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("output_file").Range(Range("E4"), ActiveCell.SpecialCells(xlCellTypeConstants, xlNumbers))
ActiveChart.Location Where:=xlLocationAsObject, Name:="output_file"
End Sub
I get the error
"Run-time error 1004: Method 'Range' of object '_Global' failed"
The strange part is that the macro will generate the graph anyway (after I select END from the popup). Any ideas as to why I get this error?