Monday, August 17, 2009

VBA Layer PlotStyle

When trying set the PlotStyle of a Layer the PlotStyle needs to be used in the drawing. If the plotstyle is not used in the drawing you get a “Key not found” error. Doing a search of the internet didn’t result in an answer. I finally found an answer here:

It appears that while the layer cannot be assigned a plotstyle an object can. So the solution is to create a temporary object then apply the plotstyle. After the plotstyle has been applied the object can be deleted.


Using Resume at the end of the ErrHandler has the code go back to the line that the error happened at, Resume Next would have it go the next line of code after the error.

No comments:


Blog Widget by LinkWithin