close

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(quot;c:\mypicture.jpgquot;).se lect, it
works fine.

??????--
maximus73
------------------------------------------------------------------------
maximus73's Profile: www.excelforum.com/member.php...oamp;userid=25877
View this thread: www.excelforum.com/showthread...hreadid=522865I'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 = quot;C:\asdf.jpgquot;

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

If testStr = quot;quot; Then
MsgBox StringVariable amp; quot; doesn't existquot;
Else
Set myPict = ActiveSheet.Pictures.Insert(StringVariable)
End If

maximus73 wrote:
gt;
gt; when I use, ActiveSheet.Pictures.Insert(stringVariable).Select , I
gt; receive the following error.
gt;
gt; Runtime error '1004':
gt;
gt; Unable to get the Insert property of the Pictures class
gt;
gt; If I use, ActiveSheet.Pictures.Insert(quot;c:\mypicture.jpgquot;).se lect, it
gt; works fine.
gt;
gt; ??????
gt;
gt; --
gt; maximus73
gt; ------------------------------------------------------------------------
gt; maximus73's Profile: www.excelforum.com/member.php...oamp;userid=25877
gt; View this thread: www.excelforum.com/showthread...hreadid=522865

--

Dave Peterson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()