Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign code to shape
Hi,
I have an application which addss a bar chart to a new workbook, adds a scroll bar to the chart and then assign code to the scrollbar shape. The code assigned is written on fly and placed in a general code module. When executing the assignment with the following code I get an error on the .OnAction statement (1004) Charts(PlotName).Activate Charts(PlotName).Shapes("Scroll Bar 1").Select With Selection .Value = 3 .Min = 3 .Max = Tpoints + 2 .SmallChange = 1 .LargeChange = Application.WorksheetFunction. _ Max(1, Tpoints / 500) .Display3DShading = True .Name = "scb_" & PlotName .OnAction = SelectedBooks(0) & _ "!ScrollBarTime" & PlotName End With If, in the .OnAction statement, I do not qualify the name of the sub with the workbook name where the code resides I do not get an error, but the shape object can't find the code as VBA has qualified it with the addin book name. Is there a way around this? Any help appreciated |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign code to shape
Forget this one,
Sorry bout it but I'd forgotten to check for forbidden charcters in the book name. -----Original Message----- Hi, I have an application which addss a bar chart to a new workbook, adds a scroll bar to the chart and then assign code to the scrollbar shape. The code assigned is written on fly and placed in a general code module. When executing the assignment with the following code I get an error on the .OnAction statement (1004) Charts(PlotName).Activate Charts(PlotName).Shapes("Scroll Bar 1").Select With Selection .Value = 3 .Min = 3 .Max = Tpoints + 2 .SmallChange = 1 .LargeChange = Application.WorksheetFunction. _ Max(1, Tpoints / 500) .Display3DShading = True .Name = "scb_" & PlotName .OnAction = SelectedBooks(0) & _ "!ScrollBarTime" & PlotName End With If, in the .OnAction statement, I do not qualify the name of the sub with the workbook name where the code resides I do not get an error, but the shape object can't find the code as VBA has qualified it with the addin book name. Is there a way around this? Any help appreciated . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How Can I Assign an Specific Code to every Product | Excel Discussion (Misc queries) | |||
Assign a code to a range of time | Excel Worksheet Functions | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |