H
haisat
Hi,
I am very new to Excel Macros and VBScript. But I need to write a
Macro very urgently. This macro just takes a datafile and draws a
graph. I am able to do up this point if datafile name is constant. But
datafile name keeps changing with date(in follwing script..
swapmemory_results.101703 is the datafile. here 101703 is the date
which causes change of filename everyday). Could anybody help me out
how to make macro not dependent on date. I am pasting the code
here....
Sub test2()
'
' test2 Macro
' Macro recorded 10/17/2003 by ibm user
'
' Keyboard Shortcut: Ctrl+u
'
ChDir "C:\new Applications\Tower-G"
Workbooks.OpenText FileName:= _
"C:\new Applications\Tower-G\swapmemory_results.101703",
Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False,
Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(1, 1)
Cells.Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData
Source:=Sheets("swapmemory_results.101703").Range( _
"A1:A29"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:= _
"swapmemory_results.101703"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Swap Memory usage - GLITR"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Time
in min"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "kb"
End With
End Sub
Thanks in advance
I am very new to Excel Macros and VBScript. But I need to write a
Macro very urgently. This macro just takes a datafile and draws a
graph. I am able to do up this point if datafile name is constant. But
datafile name keeps changing with date(in follwing script..
swapmemory_results.101703 is the datafile. here 101703 is the date
which causes change of filename everyday). Could anybody help me out
how to make macro not dependent on date. I am pasting the code
here....
Sub test2()
'
' test2 Macro
' Macro recorded 10/17/2003 by ibm user
'
' Keyboard Shortcut: Ctrl+u
'
ChDir "C:\new Applications\Tower-G"
Workbooks.OpenText FileName:= _
"C:\new Applications\Tower-G\swapmemory_results.101703",
Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False,
Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(1, 1)
Cells.Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData
Source:=Sheets("swapmemory_results.101703").Range( _
"A1:A29"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:= _
"swapmemory_results.101703"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Swap Memory usage - GLITR"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Time
in min"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "kb"
End With
End Sub
Thanks in advance