LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorry here it is again

Hi sorry but that last thread, here is my code I want to display a
different pic as each button s clicked however as I click the button I
also want to delete the old one. I am having problems with the latter.
I haave outlined where there is an error in my code, can you please
check it out and give me some ideas on what to do?
Much appreciated


Public myPic As Picture '
Public sPic As String
Sub InsertPic1()
'
' InsertPic1 Macro
' Macro recorded 23/05/2004 by Richard


sPic = Sheets("Main").Cells(100, 6).Value
------------------------------------------------------------
'error here on trying to detect if there is already a pic on sheet

If sPic < "" Then
'I get the error here
Set myPic = ActiveSheet.Pictures(sPic)
myPic.Delete
End If
--------------------------------------------------------------

sPic = ("F:\Dss\ass\Arran1.jpg")
Sheets("Main").Select
Range("D16").Select
Set myPic = ActiveSheet.Pictures.Insert(sPic)

'storing pic ref here for delete
Sheets("Main").Cells(100, 6).Value = sPic

End Sub


---
Message posted from http://www.ExcelForum.com/

 
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



All times are GMT +1. The time now is 06:16 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"