Live-Forum - Die aktuellen Beiträge
Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender

Forumthread: Sub oder function nicht definiert-was muss man ändern?

Sub oder function nicht definiert-was muss man ändern?
07.06.2024 11:40:54
Stefan95
Sub CreateHelicobacterPyloriPresentation()
Dim pptApp As Object
Dim pptPres As Object
Dim slideIndex As Integer

' Create a new PowerPoint application and presentation
Set pptApp = CreateObject("PowerPoint.Application")
pptApp.Visible = True
Set pptPres = pptApp.Presentations.Add

' Add Title Slide
AddTitleSlide pptPres, "Helicobacter pylori Infection and Associated Pathology in the Elderly", _
"A Comprehensive Overview", "Your Name", "University Name", "Date"

' Add Content Slides
slideIndex = 2
AddContentSlide pptPres, slideIndex, "Introduction", _
"Introduction to Helicobacter pylori (H. pylori)" & vbCrLf & _
"• Brief description of H. pylori" & vbCrLf & _
"• Overview of its significance in human health"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Epidemiology of H. pylori in the Elderly", _
"Prevalence" & vbCrLf & _
"• Statistics on H. pylori infection in elderly populations" & vbCrLf & _
"Risk Factors" & vbCrLf & _
"• Age-related factors" & vbCrLf & _
"• Socioeconomic status" & vbCrLf & _
"• Lifestyle and diet"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Pathogenesis of H. pylori Infection", _
"Mechanisms of Infection" & vbCrLf & _
"• How H. pylori colonizes the stomach" & vbCrLf & _
"• Virulence factors (e.g., urease, flagella, adhesins)" & vbCrLf & _
"Immune Response" & vbCrLf & _
"• Body’s immune reaction to H. pylori"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Clinical Manifestations in the Elderly", _
"Symptoms" & vbCrLf & _
"• Common gastrointestinal symptoms (e.g., abdominal pain, nausea)" & vbCrLf & _
"• Atypical symptoms in the elderly" & vbCrLf & _
"Diagnosis" & vbCrLf & _
"• Diagnostic methods (e.g., urea breath test, stool antigen test, endoscopy)"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Associated Pathologies", _
"Gastritis" & vbCrLf & _
"• Acute vs. chronic gastritis" & vbCrLf & _
"Peptic Ulcer Disease" & vbCrLf & _
"• Gastric and duodenal ulcers" & vbCrLf & _
"Gastric Cancer" & vbCrLf & _
"• Increased risk in the elderly" & vbCrLf & _
"MALT Lymphoma" & vbCrLf & _
"• Association with H. pylori infection"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Impact on Elderly Health", _
"Complications" & vbCrLf & _
"• Bleeding ulcers" & vbCrLf & _
"• Perforation" & vbCrLf & _
"• Impact on quality of life" & vbCrLf & _
"Mortality and Morbidity" & vbCrLf & _
"• Statistics on severe outcomes"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Treatment Strategies", _
"Eradication Therapy" & vbCrLf & _
"• Antibiotic regimens (e.g., triple therapy, quadruple therapy)" & vbCrLf & _
"Adjunctive Therapies" & vbCrLf & _
"• Proton pump inhibitors (PPIs)" & vbCrLf & _
"• Lifestyle modifications" & vbCrLf & _
"Challenges in the Elderly" & vbCrLf & _
"• Antibiotic resistance" & vbCrLf & _
"• Comorbidities and polypharmacy"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Prevention and Management", _
"Preventive Measures" & vbCrLf & _
"• Hygiene practices" & vbCrLf & _
"• Dietary modifications" & vbCrLf & _
"Regular Monitoring" & vbCrLf & _
"• Follow-up protocols for elderly patients" & vbCrLf & _
"Public Health Strategies" & vbCrLf & _
"• Awareness campaigns"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Case Studies/Examples", _
"Case Study 1" & vbCrLf & _
"• Description and outcomes" & vbCrLf & _
"Case Study 2" & vbCrLf & _
"• Description and outcomes"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Recent Research and Advances", _
"Current Studies" & vbCrLf & _
"• Recent findings on H. pylori infection in the elderly" & vbCrLf & _
"Future Directions" & vbCrLf & _
"• Potential new treatments" & vbCrLf & _
"• Vaccine development"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Conclusion", _
"Summary of Key Points" & vbCrLf & _
"• Reiteration of the significance of H. pylori in the elderly" & vbCrLf & _
"Final Thoughts" & vbCrLf & _
"• Importance of early detection and treatment"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "References", _
"Citations" & vbCrLf & _
"• List of all sources referenced in your presentation"

slideIndex = slideIndex + 1
AddContentSlide pptPres, slideIndex, "Questions and Discussion", _
"Invitation for Questions" & vbCrLf & _
"• Encourage audience interaction"

End Sub

Sub AddTitleSlide(pptPres As Object, title As String, subtitle As String, author As String, university As String, date As String)
Dim slide As Object
Set slide = pptPres.Slides.Add(1, 1)
slide.Shapes.Title.TextFrame.TextRange.Text = title
slide.Shapes.Placeholders(2).TextFrame.TextRange.Text = subtitle & vbCrLf & author & vbCrLf & university & vbCrLf & date
End Sub

Sub AddContentSlide(pptPres As Object, slideIndex As Integer, title As String, content As String)
Dim slide As Object
Set slide = pptPres.Slides.Add(slideIndex, 2)
slide.Shapes.Title.TextFrame.TextRange.Text = title
slide.Shapes.Placeholders(2).TextFrame.TextRange.Text = content
End Sub
Anzeige

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Sub oder function nicht definiert-was muss man ändern?
07.06.2024 12:07:43
JoWE
Hallo Unbekannter 'Stefan96' !!!

Du hast, was nicht wirklich gern gesehen ist, in Deinem Mitteilungsdrang
leider völlig die obligatorische Begrüßung und den Gruß am Ende des Beitrags vergessen.
Du hast vermutlich überlesen, dass es sich hier um ein EXCEL-Forum handelt,
jedenfalls lässt sich in Deiner Frage nicht der geringste Hinweis auf Excel erkennen.
daher ein Tipp: Frag' doch einfach in einem PowerPoint-Forum nach :=)

Gruß
Jochen
Anzeige
AW: Sub oder function nicht definiert-was muss man ändern?
07.06.2024 12:17:00
Der Steuerfuzzi
Hallo,

keine Ahnung, was da Schief läuft. Du postest hier einfach einen ellenlangen Code (auch noch ohne Code-Tags) ohne Erläuterungen oder Erklärungen und erwartest eine Antwort.

Was mir sofort aufgefallen ist, dass Du in einer Funktion "Date" als Variable verwendest. Das ist ein Schlüsselwort, das nicht als Variable zulässig ist:
Sub AddTitleSlide(pptPres As Object, title As String, subtitle As String, author As String, university As String, date As String)


Darauf müsste Dich aber die VBE eigentlich hingewiesen haben.

Gruß
Michael
Anzeige
AW: Sub oder function nicht definiert-was muss man ändern?
07.06.2024 13:55:18
volti
Hallo zusammen,

kopiert man sich den code mal eben in ein Modul (egal ob in Excel oder PPt, mit oder ohne Tags) wird einem das "date as string" gleich rot angezeigt, so wie Michael es schon angezeigt hatte.
Und da hat man auch schon den Übeltäter.

Gruß KH
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige