View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default Error when inserting AutoShape ????????

Les,
I'm glad that it worked out for you. Still - it is a complete mystery
to me what was happening to you earlier. When I pasted your code into
Excel it worked right away with no problem. "Selection" seems to be
under-documented. In the first line of your code Selection seems to be
set to point to a shape object - but then later Selection.Font (for
example) is used even though shapes don't have fonts. It looks like
your code came from editing a recorded macro (which tends to do
everything via Selection). In this case the code the macro-recorder
generated seems counterintuitive. Did you edit-out some Selects? Maybe
when you entered the text into the shape the Selection changed
implicitly but this change left no footprint in the recorded code.
Still - why it would run in one project but not another is beyond me.
Maybe it has to do with what the Active Window is when you run the code
in the second project.

-John Coleman

Les Stout wrote:
Thank you so much John, works great now.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***