LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Avi Avi is offline
external usenet poster
 
Posts: 29
Default " Select method of range class failed" if sheet not on top

Have you tried bringing sheet "effic" on top ?
Worksheets("Effic").Select ?

Dim Pict As Object
Dim p As Object
Filename$ = "C:\aScopePic\jdpic7.png"
DoThis$ = "c:\windows\wgetbin\wget.exe -t1 -O"
DoThis$ = DoThis$ + "C:\aScopePic\jdpic8.png"
DoThis$ = DoThis$ + " 10.32.54.19/Image.png"
If Dir(Filename$) = "" Then Stop
ret = Shell(DoThis$):
' Works so far, pic saved locally
' Now the following works ONLY if the Effic tab was on top when I run
the VBA
' Otherwise the next line returns " Select method of range class
failed"
'Change starts here
Worksheets("Effic").Select
'Change ends here
Worksheets("Effic").Range("B3:F18").Select
Worksheets("Effic").Range("B3:F18").Activate
ActiveSheet.Pictures.Insert (Filename$)
' I would like to be able to insert the picture onto any of the
sheets
' THANK YOU !!!!

On May 14, 10:50*am, jad700 wrote:
Dim Pict As Object
Dim p As Object
Filename$ = "C:\aScopePic\jdpic7.png"
DoThis$ = "c:\windows\wgetbin\wget.exe *-t1 -O"
DoThis$ = DoThis$ + "C:\aScopePic\jdpic8.png"
DoThis$ = DoThis$ + " 10.32.54.19/Image.png"
If Dir(Filename$) = "" Then Stop
ret = Shell(DoThis$):
' Works so far, pic saved locally
' Now the following works ONLY if the Effic tab was on top when I run
the VBA
' Otherwise the next line *returns " Select method of range class
failed"
Worksheets("Effic").Range("B3:F18").Select
Worksheets("Effic").Range("B3:F18").Activate
ActiveSheet.Pictures.Insert (Filename$)
' I would like to be able to insert the picture onto any of the
sheets
' THANK YOU !!!!


 
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
" Select method of range class failed" if sheet not on top jad700 Excel Programming 4 May 16th 11 10:05 AM
"Select method of Range class failed" Error Ayo Excel Discussion (Misc queries) 3 September 2nd 08 07:58 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
VBA error 1004 "Select method of Range class failed" Matt J Excel Programming 6 July 3rd 04 10:05 PM
Error 1004, "select method of range class failed" paritoshmehta[_11_] Excel Programming 3 May 6th 04 10:09 PM


All times are GMT +1. The time now is 06:53 PM.

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

About Us

"It's about Microsoft Excel"