msoShapeRectangle --> Variable not defined ???

  • Thread starter Thread starter Linda Edlund
  • Start date Start date
L

Linda Edlund

Hello,
I'm receiving the following error, in the code which already has worked

Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 10, 10, 20, 20)

With shp
.Name = "abc"
.Fill.ForeColor.SchemeColor = 59
.Line.Weight = 0.25
.Line.ForeColor.SchemeColor = 22
End With

ERROR:
Compile Error: Variable not defined

and it's highlights < msoShapeRectangle > ??????


Can anyone tell me how to correct the situation?

Any help will be appreciated

Linda
 
Hi Linda

I would suspect a due to a missing reference. Possibly due to the code being
run in an earlier Excel/Office version than the one it was compiled/saved
in.

Tools > References, look for MISSING

Regards,
Peter T
 
Do you have a reference to the Office type library?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Do you have a reference to the Office type library?



The reference to the Office type library was on place, but I turned them
off and than on again and it works now so it was something there anyway.

Thanks a lot
 

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

Back
Top