+ Reply to Thread
Results 1 to 2 of 2

Insert Picture

  1. #1
    Registered User
    Join Date
    08-03-2005
    Posts
    18

    Insert Picture

    when I use, ActiveSheet.Pictures.Insert(stringVariable).Select, I receive the following error.

    Runtime error '1004':

    Unable to get the Insert property of the Pictures class

    If I use, ActiveSheet.Pictures.Insert("c:\mypicture.jpg").select, it works fine.

    ??????

  2. #2
    Dave Peterson
    Guest

    Re: Insert Picture

    I'd guess that your stringVariable doesn't contain a real filename--just a
    typo???

    I'd check first:

    Dim StringVariable As String
    Dim testStr As String
    Dim myPict As Picture

    StringVariable = "C:\asdf.jpg"

    testStr = ""
    On Error Resume Next
    testStr = Dir(StringVariable)
    On Error GoTo 0

    If testStr = "" Then
    MsgBox StringVariable & " doesn't exist"
    Else
    Set myPict = ActiveSheet.Pictures.Insert(StringVariable)
    End If




    maximus73 wrote:
    >
    > when I use, ActiveSheet.Pictures.Insert(stringVariable).Select, I
    > receive the following error.
    >
    > Runtime error '1004':
    >
    > Unable to get the Insert property of the Pictures class
    >
    > If I use, ActiveSheet.Pictures.Insert("c:\mypicture.jpg").select, it
    > works fine.
    >
    > ??????
    >
    > --
    > maximus73
    > ------------------------------------------------------------------------
    > maximus73's Profile: http://www.excelforum.com/member.php...o&userid=25877
    > View this thread: http://www.excelforum.com/showthread...hreadid=522865


    --

    Dave Peterson

+ 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