Can you at least get them to tell you where the error happens?
Help! I've had a Macro made in PowerPoint (I'm aware VBA in PowerPoint is different to Excel but hoping someone speaks the language), sending it to my client and him (and his team) are getting a dialog box come up saying "Compile Error method data not found" when filling in the form. I am not getting this so it's almost impossible to correct a problem I cannot replicate! Below is the code, if anything more is needed to help investigate let me know!
Thanks in advance!
Code:Function Fetch(alt, delim) Fetch = delim + delim + delim + delim For Each des In ActivePresentation.Designs For Each shp In des.SlideMaster.Shapes If shp.AlternativeText = alt Then 'first (slidemaster) Fetch = shp.TextFrame.TextRange.Text End If Next shp If des.HasTitleMaster Then For Each shp In des.TitleMaster.Shapes If shp.AlternativeText = alt Then 'second (titlemaster) Fetch = shp.TextFrame.TextRange.Text End If Next shp End If Next des End Function Function Submit(alt, data, b) For Each des In ActivePresentation.Designs For Each shp In des.SlideMaster.Shapes If shp.AlternativeText = alt Then 'first (slidemaster) shp.TextFrame.TextRange.Text = data If (b) Then shp.TextFrame.TextRange.Font.Bold = msoCTrue End If End If If shp.HasTextFrame Then shp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUS End If Next shp If des.HasTitleMaster Then For Each shp In des.TitleMaster.Shapes If shp.AlternativeText = alt Then 'second (titlemaster) shp.TextFrame.TextRange.Text = data If (b) Then shp.TextFrame.TextRange.Font.Bold = msoCTrue End If End If If shp.HasTextFrame Then shp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUS End If Next shp End If For Each Layout In des.SlideMaster.CustomLayouts For Each shp In Layout.Shapes If shp.AlternativeText = alt Then 'first (slidemaster) shp.TextFrame.TextRange.Text = data If (b) Then shp.TextFrame.TextRange.Font.Bold = msoCTrue End If End If If shp.HasTextFrame Then shp.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUS End If Next shp Next Layout Next des End Function Sub FORM() UserForm1.Show End Sub
Last edited by RoryA; Feb 10th, 2014 at 11:39 AM. Reason: Add code tags
Can you at least get them to tell you where the error happens?
I was sent this screengrab, if it helps
imgur: the simple image sharer
That would seem to indicate that there is a control missing, or it has a different name.
what the form looks like in action: imgur: the simple image sharer
how would you suggest the best way to resolve this would be?
Well it appears that Slide90 should have a control called lblVersionStatus but doesn't. To be honest, unless the other party has deleted it by mistake, I don't see how it could work for you but not for them.
I'll give that a whirl, thanks for your help!
That's what has me confused, I checked their OS etc. but I'm pretty sure that wouldn't make a difference anyway. As you can imagine it's pretty frustrating that I have to send it over to the client and await prolonged replies as to whether it works or not.
Thanks again![]()
Hi Rory
The area marked red is highlighted yellow when this is run and does not work, so your above statement is correctCode:Private Sub CommandButton1_Click() With Me Version = .txtVersion.Value Status = .txtStatus.Value Daate = .txtDate.Value Owner = .txtOwner.Value Creator = .txtCreator.Value Fuunction = .txtFunction.Value Approver = .txtApprover.Value DocID = .txtDocID.Value DocLocation = .txtDocLocation.Value Filename = .txtFileName.Value Classification = .cmbClassification.Value End With With Slide90 .lblVersionStatus.Caption = Version & "/" & Status .lblDate.Caption = Daate .lblOwner.Caption = Owner .lblCreator.Caption = Creator .lblFunction.Caption = Fuunction .lblApprover.Caption = Approver .lblDocID.Caption = DocID .lblDocLocation.Caption = DocLocation .lblVersionStatus.ForeColor = RGB(18, 65, 145) .lblDate.ForeColor = RGB(18, 65, 145) .lblOwner.ForeColor = RGB(18, 65, 145) .lblCreator.ForeColor = RGB(18, 65, 145) .lblFunction.ForeColor = RGB(18, 65, 145) .lblApprover.ForeColor = RGB(18, 65, 145) .lblDocID.ForeColor = RGB(18, 65, 145) .lblDocLocation.ForeColor = RGB(18, 65, 145) End With
The highlighted section is the only macro that drops two parts of text into one box (if that makes sense) I'm going to try separate them into two and see if that makes a difference, because that's the only thing that differentiates this from the other, working parts of this FORM.
If you've got any ideas do let me know!
Thanks![]()
Like this thread? Share it with others