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: 6
Default Macro not firing off

I have an Excel 2000 workbook that creates a set of square shapes, which are
named 'ButtonNNN' where NNN is a number eg. 013. When clicked they are
supposed to fire off a macro and pass the parameter indicated by the NNN -
ie. 13 in this example.

This works fine. But on a few PCs the macro does not get fired off; nothing
happens. Can someone tell me why?

Here is my code, and a simplified test workbook can be downloaded here.
http://www.askhiran.com/excel/expandtroubleshoot.xls

Sub CreateSquares()
For i = 1 To 5
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 1, 1, 20#,
20#).Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Name = "Button" +
Excel.WorksheetFunction.Text(i, "000")
'this is an undocumented Excel VBA syntax! see Tom Ogilvy Jan
20, 2003. Thanks Tom.
'eg. Selection.OnAction = "'ExpandSummarise 10'"
strAction = "'ExpandSummarise " + Trim(Str(i)) + "'"
Selection.OnAction = strAction

'show expand buttons
strButtonName = "Button" + Excel.WorksheetFunction.Text(i,
"000")
ActiveSheet.Shapes(strButtonName).Left = 200
ActiveSheet.Shapes(strButtonName).Top = (i * 30 + 5) + 75
ActiveSheet.Shapes(strButtonName).Fill.ForeColor.S chemeColor
= 51
ActiveSheet.Shapes(strButtonName).Fill.Visible = msoTrue
ActiveSheet.Shapes(strButtonName).Line.Visible = msoFalse
Next i
Range("A1").Select
End Sub

Sub ExpandSummarise(intLineToExpand As Integer)
'Debug code
MsgBox intLineToExpand
End Sub

Thanks,
Hiran





 
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
How can I test if a Macro if firing? ZZBC Excel Worksheet Functions 6 January 31st 06 03:09 AM
Event macro firing twice Otto Moehrbach Excel Programming 10 July 6th 05 11:57 PM
Workbook_Open event not firing 0013 Excel Programming 4 May 24th 05 09:53 PM
Event sometimes stops firing? HotRod Excel Programming 7 May 5th 05 12:20 AM
Multiple firing of macro from ListBox SteveF Excel Programming 2 December 9th 04 08:21 AM


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