Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2022, 05:49 PM
cybersurfer5000 cybersurfer5000 is offline VBA caption command Mac OS X VBA caption command Office 2021
Novice
VBA caption command
 
Join Date: Feb 2022
Posts: 6
cybersurfer5000 is on a distinguished road
Default 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
Attached Images
File Type: png Screen Shot 2022-02-12 at 7.43.31 PM.png (18.9 KB, 9 views)
Reply With Quote
  #2  
Old 02-13-2022, 10:11 AM
JohnWilson JohnWilson is offline VBA caption command Windows 10 VBA caption command Office 2019
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

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
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
Reply



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
VBA caption command 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

Other Forums: Access Forums

All times are GMT -7. The time now is 07:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft