Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Stepping Problem,

I know I posted this earlier, but the response I recieved did not help any.
Though I did appreciate the response.

Stepping through a program will achieve the desired results, but running it
normally will error out.

First, a Worksheet Change Event is recieved, this in turns calls a Sub to
add an AutoShape to a worksheet.
If code is allowed to run normally I will always recieve a
1004 Application-Defined or Object Defined error at the line that actually
ADDS the shape

Set sh = wks.Shapes.AddShape(msoShapeDownArrow, 354.75, 162 + (rown * 21),
24, 30)

wks is passed as an argument to the sub from the worksheet change event and
sh is a shared public variable as Shape

when stepping the code does not error out.
Anyone know why this might be doing so?









--
When you lose your mind, you free your life.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Stepping Problem,

Try this, I take it rown is the row number
this worked fine for me

Dim shp As Shape

Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As Range)

Set shp = sh.Shapes.AddShape(msoShapeDownArrow, 354.75, 162 +ActiveCell.Row
* 21, 24, 30)

End Sub



"ben" (remove this if mailing direct) wrote in message
...
I know I posted this earlier, but the response I recieved did not help any.
Though I did appreciate the response.

Stepping through a program will achieve the desired results, but running
it
normally will error out.

First, a Worksheet Change Event is recieved, this in turns calls a Sub to
add an AutoShape to a worksheet.
If code is allowed to run normally I will always recieve a
1004 Application-Defined or Object Defined error at the line that actually
ADDS the shape

Set sh = wks.Shapes.AddShape(msoShapeDownArrow, 354.75, 162 + (rown * 21),
24, 30)

wks is passed as an argument to the sub from the worksheet change event
and
sh is a shared public variable as Shape

when stepping the code does not error out.
Anyone know why this might be doing so?









--
When you lose your mind, you free your life.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Stepping Problem,

your code works well,
but shape is not visible.
so "shp.Visible = msoTrue" is required

Best regards
sjoo

  #4   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Stepping Problem,

This question was actually finally presented with a work around in a previous
post, it seems that other people have add this issue and had to have excel
Select something else (doesn't matter what) before creating the shape.

--
When you lose your mind, you free your life.


" wrote:

your code works well,
but shape is not visible.
so "shp.Visible = msoTrue" is required

Best regards
sjoo


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
Stepping through Code Jim May Excel Discussion (Misc queries) 9 October 25th 07 01:40 PM
stepping chart Petje Charts and Charting in Excel 2 July 7th 06 10:22 PM
Stepping through For Each...Next backwards? Mike Lee[_2_] Excel Programming 5 June 6th 04 07:42 PM
stepping down rows JasonMeyer Excel Programming 5 February 23rd 04 08:02 PM
Stepping through a column using FOR/NEXT Joe Mathis Excel Programming 1 December 3rd 03 06:36 AM


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

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"