ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macros on charts that use fixed filenames (https://www.excelbanter.com/excel-programming/317340-macros-charts-use-fixed-filenames.html)

matt dunbar

macros on charts that use fixed filenames
 
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!

mangesh_yadav[_202_]

macros on charts that use fixed filenames
 

The syntax is ThisWorkbook

- Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=31866



All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com