Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Run-time error '1004'" Method 'Range' of object '_global' failed.

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 10 April 16th 09 09:06 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
Method 'Range' of object '_global' failed higherlimits Excel Discussion (Misc queries) 3 June 23rd 06 06:16 PM
runtime error 1004 method range of object '_global failed valdesd Excel Discussion (Misc queries) 2 October 6th 05 07:26 PM
Method 'Range' of object '_Global' failed Mohanasundaram[_2_] Excel Programming 1 August 25th 03 01:43 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"