+ Reply to Thread
Results 1 to 4 of 4

msoShapeRectangle --> Variable not defined ???

  1. #1
    Linda Edlund
    Guest

    msoShapeRectangle --> Variable not defined ???

    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


  2. #2
    Peter T
    Guest

    Re: msoShapeRectangle --> Variable not defined ???

    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

    "Linda Edlund" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  3. #3
    Bob Phillips
    Guest

    Re: msoShapeRectangle --> Variable not defined ???

    Do you have a reference to the Office type library?

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Linda Edlund" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  4. #4
    Linda Edlund
    Guest

    Re: msoShapeRectangle --> Variable not defined ???

    "Bob Phillips" <[email protected]> wrote in
    news:[email protected]:

    > 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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1