Powerpoint and Access

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

I have a Powerpoint 97 slide with packaging line layout. I have an
access 97 database that tracks the breakdown data from all machines on
the line. I am using text boxes on the slide to identify each piece of
equipment. Is it possibe to change the background color in the text
box depending upon information in an access report? I would like the
box to be red if it has had a breakdown in the last 90 days and green
if the equipment has gone over 90 days without a breakdown.
Thanks
Doug
 
This kind of conditional formatting can be done via VBA in PowerPoint or by
using the conditional formatting within Excel and linking to the
spreadsheet. Are you familiar with VBA?

How do the numbers get into the text boxes?

--

Bill Dilworth
Microsoft PPT MVP Team
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
Familiar with VBA but no expert, I dont have the numbers in the text box, I
have the asset number in the text box and would like to base the background
color on the number <90 or >90 that is calculated in the report in access.
Doug
 
Does this get you started? (You said you knew a little VBA, so open the VBE
in PowerPoint and paste this macro into the window.)

===================================
Sub ColorMyAssets()
'This macro will color the first shape on the
' first slide depending on the value in a
' stored Excel sheet.

'Start late binding
Dim oApp As Object

'Open Excel
Set oApp = CreateObject("Excel.Sheet")

'Open Saved Excel Sheet
oApp.Application.Workbooks.Open "C:\MyAssetNumbers.xls"

'Set assumed prefix
With ActivePresentation.Slides(1).Shapes(1)
.Fill.Visible = True

'Check value of Cell A1
If oApp.Application.ActiveWorkbook _
.Worksheets("Sheet1").Range("A1:A1") >= 90 Then

'If 90 or over, then color box red
.Fill.ForeColor.RGB = RGB(255, 0, 0)

'Otherwise color it green
Else
.Fill.ForeColor.RGB = RGB(0, 255, 0)
End If

'End assumed prefix
End With

'Quit and get rid of Excel object
oApp.Application.Quit
Set oApp = Nothing

End Sub
===================================

Post back if you need additional help.

--
Bill Dilworth
Microsoft PPT MVP Team
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
You could extend this by tagging the relevant shapes with the range ( "A1:A1" )
where the shape's data is to be found ( or with the range name, probably? )

That way you could cycle through all the shapes on the slide, while the excel
object is alive, and look up the goods for each shape that needs it.
 
Back
Top