Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to draw a graph using a Macro and I am getting "Run-time error '1004'" Method 'Range' of object '_global' failed. Could any body help me out in fixing this problem. line Range("A1:A340").Select is giving the error. ..................Code................. Sub swapmemory() ' ' swapmemory Macro ' Macro recorded 10/20/2003 by ibm user ' ' Keyboard Shortcut: Ctrl+q ' Dim sDate As String Dim sfile As String sDate = Format(Date, "mmddyy") sfile = "swapmemory_results." & sDate ChDir "C:\new Applications\Tower-G" Workbooks.OpenText FileName:= _ "C:\new Applications\Tower-G\" & sfile, Origin:=xlWindows, _ StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _ , Space:=False, Other:=False, FieldInfo:=Array(1, 1) Range("A1:A340").Select Charts.Add ActiveChart.ChartType = xlLineMarkers ActiveChart.SetSourceData Source:=Sheets(sfile).Range( _ "A1:A45"), PlotBy:=xlColumns ActiveChart.Location Whe=xlLocationAsObject, Name:= _ sfile With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "Swap Memory Results -- GLITR" .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = _ "time(each unit = 5min)" .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Kb" End With End Sub Thanks in advance. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error '1004': AutoFill method of Range class failed | Excel Discussion (Misc queries) | |||
Run-time error "1004" Select method of range class failed | Excel Discussion (Misc queries) | |||
Method 'Range' of object '_global' failed | Excel Discussion (Misc queries) | |||
runtime error 1004 method range of object '_global failed | Excel Discussion (Misc queries) | |||
Method 'Range' of object '_Global' failed | Excel Programming |