Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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
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 Assign an Specific Code to every Product Gmata Excel Discussion (Misc queries) 5 December 31st 07 07:21 PM
Assign a code to a range of time Elizabeth Excel Worksheet Functions 15 October 28th 07 06:42 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


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