+ Reply to Thread
Results 1 to 2 of 2

Run-Time Error: You must select a shape

  1. #1
    Lee
    Guest

    Run-Time Error: You must select a shape

    I received a Microsoft Visual Basic Error at run-time which read "You must
    select a shape". It was a warning prompt and it did not highlight a line of
    code when I attempted to debug.

    When the prompt is cleared the code continues to run. However, the problem
    is that the code stops.

    My Excel VBA code is performing a copy of worksheets from one workbook to
    another.

    After examining the workbook where the problem appeared to occur, I
    discovered that a chart in the workbook had the focus or was left selected by
    a user. There is also a pivot table on the same worksheet as the chart.

    When I remove the focus from the chart, by selecting a cell on the
    worksheet, the error is no longer produced.

    Is this a bug, or designed behavior?

  2. #2
    Don Guillett
    Guest

    Re: Run-Time Error: You must select a shape

    you could make something like this as your first line.
    ActiveSheet.ChartObjects("chart 1").Chart.Deselect

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Lee" <[email protected]> wrote in message
    news:[email protected]...
    > I received a Microsoft Visual Basic Error at run-time which read "You must
    > select a shape". It was a warning prompt and it did not highlight a line

    of
    > code when I attempted to debug.
    >
    > When the prompt is cleared the code continues to run. However, the

    problem
    > is that the code stops.
    >
    > My Excel VBA code is performing a copy of worksheets from one workbook to
    > another.
    >
    > After examining the workbook where the problem appeared to occur, I
    > discovered that a chart in the workbook had the focus or was left selected

    by
    > a user. There is also a pivot table on the same worksheet as the chart.
    >
    > When I remove the focus from the chart, by selecting a cell on the
    > worksheet, the error is no longer produced.
    >
    > Is this a bug, or designed behavior?




+ 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