Live-Forum - Die aktuellen Beiträge
Datum
Titel
23.04.2024 14:59:21
23.04.2024 14:47:39
23.04.2024 14:23:45
Anzeige
Archiv - Navigation
584to588
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
584to588
584to588
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

ppt zugriff aus excel vba

ppt zugriff aus excel vba
16.03.2005 10:59:51
tom
Hallo zusammen,
ich versuche aus einer Excel tabelle die daten einzelner zellen in textboxen nach ppt "transferieren" und diese gruppieren. (und dann manuell weitermachen)
Ich finde leider keine lösung, wie ich es hinbekomme, dass er die textboxen variabel ansprechen kann. heisst nach jeder schleife heissen die textboxen anders.
zb.
1. schleife
textbox 1, textbox 2, textbox 3, textbox 4,
2. schleife
textbox 5, textbox 6, textbox 7, textbox 8,
ich wollte einen counter einbauen(tb1= tb1+4), damit er immer wieder zum gruppieren auf die grade neu angelegten textboxen zugreifen kann(um diese dann zu gruppieren)
ich hab es so versucht die textboxen variabel anzusprechen. aber er sagt immer wieder nicht gefunden:
myDocument.Shapes.Range(Array("Text Box" & tb1, "Text Box" & tb2, "Text Box" & tb3, "Text Box" & tb4)).Group
Ich komm seit gestern Abend nicht mehr weiter damit. kann mir bitte jemand helfen?
hier nochmal der ganze code (ist noch ohne counter, hab die variablen manuell deklariert)

Sub bubbles_anlegen()
Set appPowerPt = CreateObject("PowerPoint.Application")
appPowerPt.Visible = True
appPowerPt.Presentations.Open Filename:="C:\Testing\Test.ppt"
Set myDocument = appPowerPt.Presentations(1).slides(1)
'hier Anfang Schleife
ThisWorkbook.Activate
Range("A2").Select
appPowerPt.Activate
'ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeOval, 60#, 48#, 294#, 114#).Add
Do Until ActiveCell.Value = ""
ThisWorkbook.Activate
komp = ActiveCell.Value
ActiveCell.Cells(1, 2).Select
ist = ActiveCell.Value
ActiveCell.Cells(1, 2).Select
soll = ActiveCell.Value
ActiveCell.Cells(1, 2).Select
fl = ActiveCell.Value
'zuordnungstabelle textboxen
'start ppt routine
With myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
100, 200, 300, 50).TextFrame 'komp
.TextRange.Text = "Kernkompetenz: " & komp
'.Caption = "testname"
End With
'myDocument.ActiveForm.Caption = testname
With myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
70, 170, 100, 50).TextFrame 'Ist
.TextRange.Text = "Ist: " & ist
End With
With myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
70, 230, 100, 50).TextFrame 'Soll
.TextRange.Text = "Soll: " & soll
End With
With myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
200, 170, 100, 50).TextFrame 'Fl
.TextRange.Text = "FL: " & fl
End With
'myDocument.activetextbox.Name = "tbtest"
'zuordungstabelle
tb1 = 5
tb2 = 6
tb3 = 7
tb4 = 8
'gruppieren
'myDocument.Shapes.Range(Array("Text Box" & tb1, "Text Box" & tb2)).Group
myDocument.Shapes.Range(Array("Text Box" & tb1, "Text Box" & tb2, "Text Box" & tb3, "Text Box" & tb4)).Group
'end ppt routine
ThisWorkbook.Activate
ActiveCell.Offset(1, -3).Select
Loop
End Sub


viele grüße
Thomas

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: ppt zugriff aus excel vba
16.03.2005 13:52:17
Werner
Hallo Tom,
versuch es mal mit der Methode unten.
Die Textboxen werden dort als Objektvariablen angelegt.
Dann kann man sie eindeutig benennen und auch über den Namen auf sie zugreifen.
mfg
Werner

Sub bubbles_anlegen()
Set appPowerPt = CreateObject("PowerPoint.Application")
appPowerPt.Visible = True
appPowerPt.Presentations.Open Filename:="H:\Eigene Dateien\Präsentation1.ppt"
Set myDocument = appPowerPt.Presentations(1).slides(1)
'hier Anfang Schleife
ThisWorkbook.Activate
Range("A2").Select
appPowerPt.Activate
'ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeOval, 60#, 48#, 294#, 114#).Add
Do Until ActiveCell.Value = ""
tb_offset = 0
ThisWorkbook.Activate
komp = ActiveCell.Value
ActiveCell.Cells(1, 2).Select
ist = ActiveCell.Value
ActiveCell.Cells(1, 2).Select
soll = ActiveCell.Value
ActiveCell.Cells(1, 2).Select
fl = ActiveCell.Value
'zuordnungstabelle textboxen
'start ppt routine
'myDocument.ActiveForm.Caption = testname
Set tb1 = myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
100, 200, 300, 50)
With tb1
.TextFrame.TextRange.Text = "Kernkompetenz: " & komp
.Name = "TB Zwangsname 1"
End With
Set tb2 = myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
70, 200, 300, 50)
With tb2
.TextFrame.TextRange.Text = "Ist: " & ist
.Name = "TB Zwangsname 2"
End With
Set tb3 = myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
70, 300, 300, 50)
With tb3
.TextFrame.TextRange.Text = "Soll: " & soll
.Name = "TB Zwangsname 3"
End With
Set tb4 = myDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, _
130, 200, 300, 50)
With tb3
.TextFrame.TextRange.Text = "FL: " & fl
.Name = "TB Zwangsname 4"
End With
'myDocument.activetextbox.Name = "tbtest"
'zuordungstabelle
'tb1 = 5
'tb2 = 6
'tb3 = 7
'tb4 = 8
'gruppieren
'myDocument.Shapes.Range(Array("Text Box" & tb1, "Text Box" & tb2)).Group
myDocument.Shapes.Range(Array(tb1.Name, tb2.Name, tb3.Name, tb3.Name)).Group
'end ppt routine
ThisWorkbook.Activate
ActiveCell.Offset(1, -3).Select
Loop
End Sub

Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige