+ Reply to Thread
Results 1 to 3 of 3

Run Time Error 91 'Oject variable or With block variable not set

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    INDIA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Run Time Error 91 'Oject variable or With block variable not set

    I am trying to create a pie chart using VBA. I wrote the below mentioned code but it gives me error 91 while executing. Can anyone help me solve this issue

    Code:

    Please Login or Register  to view this content.
    Last edited by Cutter; 08-09-2012 at 06:15 PM. Reason: Added code tags

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Run Time Error 91 'Oject variable or With block variable not set

    @ aakash_bh

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  3. #3
    Registered User
    Join Date
    08-09-2012
    Location
    INDIA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Run Time Error 91 'Oject variable or With block variable not set

    Problem has been solved. Error was in this line Set ocht = ActiveChart. It should be Set ocht = excel1.ActiveChart

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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