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
- Oct 05 Fri 2007 20:40
Insert Picture
close
全站熱搜
留言列表
發表留言