macros on charts that use fixed filenames

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top