"Compile Error method data not found"

JackMDaniels

New Member
Joined
Feb 10, 2014
Messages
24
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 a moderator:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Can you at least get them to tell you where the error happens?
 
Upvote 0
That would seem to indicate that there is a control missing, or it has a different name.
 
Upvote 0
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.
 
Upvote 0
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 :)
 
Upvote 0
Hi Rory

Code:
 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
[COLOR=#ff0000]    .lblVersionStatus[/COLOR].Caption = Version & "/" & Status[COLOR=#ff0000][/COLOR]
    .lblDate.Caption = Daate
    .lblOwner.Caption = Owner
    .lblCreator.Caption = Creator
    .lblFunction.Caption = Fuunction
    .lblApprover.Caption = Approver
    .lblDocID.Caption = DocID
    .lblDocLocation.Caption = DocLocation
   
    .lblVersionStatus.<wbr>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 area marked red is highlighted yellow when this is run and does not work, so your above statement is correct
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 :)
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top