M
matt dunbar
Hi
one problem i have with some of my macros which perform operations on
charts is that they incorporate the name of the file in the code - if
colleagues create their own versions of these files with different names
the code needs altering but the macro cannot dynamically update i
assume?
is there way of instead of writing the filename in the code it can be
referred to as "This workbook" or something like this - i tried but cant
get the syntax right just by trial and error
enlightenment from those talented and gifted out there would be
appreciated please!
TIA
matt
see code example below
-------------------------------
ActiveSheet.Unprotect
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.ColorIndex = 3
.Weight = xlThick
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End With
ActiveWindow.Visible = False
Windows("HAN04.xls").Activate
----------------------------------
matt
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
one problem i have with some of my macros which perform operations on
charts is that they incorporate the name of the file in the code - if
colleagues create their own versions of these files with different names
the code needs altering but the macro cannot dynamically update i
assume?
is there way of instead of writing the filename in the code it can be
referred to as "This workbook" or something like this - i tried but cant
get the syntax right just by trial and error
enlightenment from those talented and gifted out there would be
appreciated please!
TIA
matt
see code example below
-------------------------------
ActiveSheet.Unprotect
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.ColorIndex = 3
.Weight = xlThick
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End With
ActiveWindow.Visible = False
Windows("HAN04.xls").Activate
----------------------------------
matt
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!