+ Reply to Thread
Results 1 to 2 of 2

Run time error 1004, unable to get the insert property of the picture class

  1. #1
    Registered User
    Join Date
    08-06-2019
    Location
    calicut, india
    MS-Off Ver
    windows 10
    Posts
    0

    Run time error 1004, unable to get the insert property of the picture class

    hi

    pls help me to know that when i am trying to insert multiple pictures from a folder, am getting an run time error 1004, unable to get the insert property of the picture class. when click end picture is appearing in the cell and when clicking debug yellow color comes to the code "Set light_pic = ActiveSheet.Pictures.Insert(pic_location)"

    i dont know how to fix the problem, pls help, thanks in advance

    am using following vba code:

    Private Sub CommandButton1_Click()
    Dim light_pic As Picture
    Dim pic_location As String
    Dim light_name As String
    For i = 17 To 21
    light_name = Worksheets("Sheet1").Cells(i, 2).Value
    pic_location = "C:\Users\SERVER\Desktop\Light pictures\" & Worksheets("Sheet1").Cells(i, 2).Value & ".jpg"

    With Worksheets("Sheet1").Cells(i, 4)
    Set light_pic = ActiveSheet.Pictures.Insert(pic_location)

    light_pic.Top = .Top
    light_pic.Left = .Left
    light_pic.ShapeRange.LockAspectRatio = msoFalse
    light_pic.Placement = xlMoveAndSize
    light_pic.ShapeRange.Width = 90
    light_pic.ShapeRange.Height = 80
    End With
    Next
    Worksheets("Sheet1").Cells(1, 1).Select
    End Sub

    Private Sub Label1_Click()

    End Sub


    Regards
    Rajesh

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167
    Hello tmrajeshclt,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. [SOLVED] Run time error 1004 “Unable to get … property of WorksheetFunction class”
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2017, 03:14 PM
  2. Replies: 17
    Last Post: 11-16-2016, 01:46 AM
  3. Run-Time error 1004 (Unable to get the paste property of the picture class)
    By Johnnyv015 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2016, 08:41 AM
  4. Run Time Error "1004": Unable to get the Insert property of the picture class
    By rmeckm2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-01-2015, 01:46 PM
  5. Replies: 7
    Last Post: 10-29-2014, 04:45 AM
  6. Run-time error '1004': Unable to get the Insert property of the Pictures class
    By schmidt1962 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2013, 01:05 AM
  7. Run - time error '1004': Unable to get the Sum property of WorksheetFunction class
    By dylanrose in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 10:25 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