+ Reply to Thread
Results 1 to 2 of 2

Macro Stopped working - Application defined or object defined error

  1. #1
    Registered User
    Join Date
    03-12-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    7

    Exclamation Macro Stopped working - Application defined or object defined error

    Hi,

    I have a worksheet that creates and sends an email via outlook and it has been working fine for the last few years.

    The email includes a chart (as a picture), tables and text. For some reason the macro stopped working on my pc, it still works on other computers, which is strange.

    This is the part it is getting stuck on:


    Sub createJpg2(Namesheet As String, nameRange As String, nameFile As String)
    ThisWorkbook.Activate
    Worksheets(Namesheet).Activate
    Set plage = ThisWorkbook.Worksheets(Namesheet).Range(nameRange)
    plage.CopyPicture


    With ThisWorkbook.Worksheets(Namesheet).ChartObjects.Add(plage.Left, plage.Top, plage.Width, plage.Height)

    .Activate
    .Chart.Paste

    .Chart.Export Environ$("temp") & "\" & nameFile & ".png", "PNG"
    End With



    Worksheets(Namesheet).ChartObjects(Worksheets(Namesheet).ChartObjects.Count).Delete
    Set plage = Nothing
    End Sub

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Macro Stopped working - Application defined or object defined error

    It does not look like you dimmed the range,

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. excel macro run time error '1004'- Application defined or object defined error
    By kmadan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2014, 09:51 AM
  2. Previously working code is now is now giving Application-defined or object-defined error
    By ready2learn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2014, 07:22 PM
  3. [SOLVED] Macro Error 1004 Application Defined or object defined error. PLEASE HELP
    By balston2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2012, 10:29 AM
  4. [SOLVED] Macro causes Run time error 1004 Application defined or object-defined error
    By Firefighter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2012, 04:09 AM
  5. Macro - Run-time Error '1004': Application defined or object defined error
    By robby10 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-14-2010, 07:55 AM
  6. Application-defined or object-defined error with unshare/share macro
    By rlw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-23-2007, 07:58 AM
  7. Why doesn't working? Application-defined or object-defined error
    By SupperDuck in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2006, 11:00 AM

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