#1   Report Post  
Posted to microsoft.public.excel.misc
maximus73
 
Posts: n/a
Default 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").se lect, 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

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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").se lect, 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Picture from dropdown selection Mike at Channel New Users to Excel 21 March 22nd 06 02:14 AM
Is it possible to insert a picture using formulas? phil2401 Excel Worksheet Functions 4 December 15th 05 09:12 PM
How to insert a picture in the Footer (not the Header) in Excel 20 jmon Excel Worksheet Functions 2 March 17th 05 06:59 AM
insert picture BillGwyer Excel Discussion (Misc queries) 1 March 4th 05 07:37 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 07:57 PM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"