Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unable to set the top property of the picture class

Hi Barb

I tired this, but the error kicks in, it is when i select the name of a person on worksheet three (as example) that has also been selected on worksheet one.

with the code you suggested, i still get the same error.

any thoughts?



Barb Reinhardt wrote:

Try thisOption ExplicitPrivate Sub Worksheet_Calculate()Dim oShape As ShapeDim
28-Dec-09

Try this

Option Explicit

Private Sub Worksheet_Calculate()
Dim oShape As Shape
Dim myRange As Excel.Range

Set myRange = Me.Range("ad1")

For Each oShape In Me.Shapes
oShape.Visible = msoFalse
Next oShape

For Each oShape In Me.Shapes
If oShape.Type = 13 And _
oShape.Name = myRange.Text Then
oShape.Visible = True
oShape.Top = myRange.Top
oShape.Left = myRange.Left
Exit For
End If
Next oShape
End Sub

--
HTH,

Barb Reinhardt



"JB Bates" wrote:

Previous Posts In This Thread:

On Monday, December 28, 2009 12:13 PM
JB Bates wrote:

debug runtime error 1004
I have a workbook that contains 100 worksheets. On each work sheet I have
the following code (see below) that runs and when a particular person is
selected from a drop down list a jpg of their signature displays at the top
of each sheet.

This was working fine but I am now getting the following error after I
select a person from the drop down and then when ever i try to input data
into any other cell. The error message is:

Runtime Error '1004'" Unable to set the top property of the picture class

It then allows me to END or debug. if i select debug it opens the VBA
window to the code and highlights this line

oPic.Top = .Top

But i do not know what to to do with that line of code to debug

PLEASE HELP

thanks in advance - JB


Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("ad1")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

On Monday, December 28, 2009 7:43 PM
Barb Reinhardt wrote:

Try thisOption ExplicitPrivate Sub Worksheet_Calculate()Dim oShape As ShapeDim
Try this

Option Explicit

Private Sub Worksheet_Calculate()
Dim oShape As Shape
Dim myRange As Excel.Range

Set myRange = Me.Range("ad1")

For Each oShape In Me.Shapes
oShape.Visible = msoFalse
Next oShape

For Each oShape In Me.Shapes
If oShape.Type = 13 And _
oShape.Name = myRange.Text Then
oShape.Visible = True
oShape.Top = myRange.Top
oShape.Left = myRange.Left
Exit For
End If
Next oShape
End Sub

--
HTH,

Barb Reinhardt



"JB Bates" wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Creating a WPF Custom Control
http://www.eggheadcafe.com/tutorials...ustom-con.aspx
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
Unable to get the VLookup property of the WorksheetFunction class Ayo Excel Programming 11 September 30th 09 06:19 PM
Unable to set NumberFormat Property of Range class Ade Excel Programming 0 March 28th 07 03:07 AM
Unable to get the dropdowns property of the worksheet class??? Simon Lloyd[_726_] Excel Programming 13 May 22nd 06 11:24 PM
Unable to set the PaperSize property of the PageSetup class [email protected] Excel Programming 2 November 22nd 04 03:43 PM
Unable to set Bold property of the Font Class Mike Lee Excel Programming 2 January 19th 04 06:23 PM


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