All
I am retriving data from a device -- so the instrument generated values I put in cells that are protected -- all done using VBA. I have a timer that looks to see if there is new data from my device -- this I do every 6 seconds. I have SPC (statistical process control charts) chart on my sheets that continously is updated as I retrive new data from my device. On these charts I only update the .seriescollection as new data arrive. However I have instances where I want to chart a longer time period --- so I first delete my chartobjects on the worksheet --- next I add new charts. However the .add property (see code below) ---- I sometimes --- but only sometimes get a runtime error ---- even if I try to use the XL2007 GUI to add a chart --- all graphics are greyed out --- but if I unprotect the cells then I can add charts --- also below is the code I use to protect my cells --- is there a option I can use in the .protect property that allow me to add charts -- even if cells are protected
Code:
ActiveSheet.ChartObjects.Add Left:=LeftArr(i), Top:=TopArr(i), Width:=WidthArr(i), Height:=HeightArr(i)
ActiveSheet.ChartObjects(i + 1).Name = ChartNamesArr(i)
ActiveSheet.ChartObjects(i + 1).Activate
Code:
.Protect UserInterfaceOnly:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True
Bookmarks