Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint
Change color of a shape in PowerPoint Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Go Back  Xtreme Visual Basic Talk > > > > Change color of a shape in PowerPoint


Reply
 
Thread Tools Display Modes
  #1  
Old 06-22-2017, 10:02 AM
gilbro gilbro is offline
Newcomer
 
Join Date: Jun 2017
Location: Greater Boston
Posts: 1
Default Change color of a shape in PowerPoint


I am using PowerPoint 2010, VisualBasic 6.5.
I have a presentation with several pages, each of which has 6 identical triangles which have the same gray fill color.
I am trying to write a macro so that when I click on something (either the triangle itself or preferably a small "invisible" rectangle next to it), the fill color of the triangle changes to yellow.

I have searched online, and I found macros that create a new shape and then let you change the color, but not to change the fill of a specified existing shape.

I would love to do this by just recording a macro, but PowerPoint won't let me.

So I recorded such a macro in Word, which gave the following:

Sub AAAYellow()
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 0)
Selection.ShapeRange.Fill.Solid
End Sub

and that works every time in Word.
But when I copy that text and paste it into a script for the PowerPoint file, I click on the triangle and execute the macro, I get:
Runtime error 424: Object required

Apparently PowerPoint (nlike Word) me to tell it explicitly the name of the selected shape (triangle), and I can't figure out the script to do this. I've tried looking for analagous scripts online and just can't find any.

How do I do this?

I want to be able to use the same macro to change the color individually of each of the six triangles on the page.

Thanks so much! --Gil
Reply With Quote
Reply

Tags
color, powerpoint, macro, triangle, change, shape, fill, word, script, online, click, triangles, execute, file, runtime, error, required, object, gil, time, paste, text, copy, apparently, nlike


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
 
Change color of a shape in PowerPoint
Change color of a shape in PowerPoint
 
-->