Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I test if a Macro if firing? | Excel Worksheet Functions | |||
Event macro firing twice | Excel Programming | |||
Workbook_Open event not firing | Excel Programming | |||
Event sometimes stops firing? | Excel Programming | |||
Multiple firing of macro from ListBox | Excel Programming |