#1
|
|||
|
|||
VBA caption command
Hi.
I want to add 100 to the rectangle (named 'ascore') when clicking the up arrow that's right next to the rectangle (see screenshot). The macro is assigned to the up arrow shape. My VBA code is below. It does not work yet. Error message when run the code in the debugger: Run-time error '420' Object required. Sub ascoreplus() ascore.Caption = ascore.Caption + 100 End Sub Anyone sees where I made a mistake? Thank you very much in advance! Sophia |
#2
|
|||
|
|||
Shapes do not have a Caption. Maybe you have found Windows code using ActivX shapes. Macs do not support this
With a shape you would need something like Code:
Sub add10() Dim osld As Slide Dim oshp As Shape Set osld = SlideShowWindows(1).View.Slide Set oshp = osld.Shapes("ascore") If oshp.TextFrame.TextRange = "" Then oshp.TextFrame.TextRange = "0" oshp.TextFrame.TextRange = oshp.TextFrame.TextRange + 10 End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Command button. To multi command | Taylormations | Word VBA | 11 | 09-14-2020 02:39 AM |
Show table list by using chek box command and save document on sharepoint by using command button | Zhibek | Word VBA | 3 | 08-16-2018 06:19 PM |
Help with caption nightmare?? | justletmein | Word | 5 | 05-09-2014 06:30 PM |
Tab in TOF or caption?... | JDB | Word | 1 | 12-02-2011 12:42 PM |
Add-In:How to add command right click command bar | phang | Outlook | 0 | 01-15-2007 02:53 AM |