G
Guest
I wrote a procedure attached on a bottom of a access form which is for
selecting some data and exporting them to excel and plotting a chart. The
procedure work alternatively...that it work for the first time, then an error
of 1004 of Method 'ActiveChart' of object '_Globel' failed for the second
time then it work for the third time and so on. The below is the procedure
fragment. Can any one give me an idea?
Dim oChart As Chart
Set oSheet2 = oBook.Worksheets(2)
oSheet2.Select
oSheet2.Name = "Chart"
oSheet2.Range("A1").Select
Set oChart = oBook.Charts.Add
ActiveChart.ChartType = xlLineMarkers " the error was highlight there.
selecting some data and exporting them to excel and plotting a chart. The
procedure work alternatively...that it work for the first time, then an error
of 1004 of Method 'ActiveChart' of object '_Globel' failed for the second
time then it work for the third time and so on. The below is the procedure
fragment. Can any one give me an idea?
Dim oChart As Chart
Set oSheet2 = oBook.Worksheets(2)
oSheet2.Select
oSheet2.Name = "Chart"
oSheet2.Range("A1").Select
Set oChart = oBook.Charts.Add
ActiveChart.ChartType = xlLineMarkers " the error was highlight there.