Thanks Thanks:  0
Likes Likes:  0
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: "Compile Error method data not found"

  1. #1
    New Member
    Join Date
    Feb 2014
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default "Compile Error method data not found"

    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

  2. #2
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,930
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    5 Thread(s)

    Default Re: "Compile Error method data not found"

    Can you at least get them to tell you where the error happens?

  3. #3
    New Member
    Join Date
    Feb 2014
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: "Compile Error method data not found"

    I was sent this screengrab, if it helps

    imgur: the simple image sharer

  4. #4
    New Member
    Join Date
    Feb 2014
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: "Compile Error method data not found"


  5. #5
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,930
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    5 Thread(s)

    Default Re: "Compile Error method data not found"

    That would seem to indicate that there is a control missing, or it has a different name.

  6. #6
    New Member
    Join Date
    Feb 2014
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: "Compile Error method data not found"

    what the form looks like in action: imgur: the simple image sharer

  7. #7
    New Member
    Join Date
    Feb 2014
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: "Compile Error method data not found"

    how would you suggest the best way to resolve this would be?

  8. #8
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,930
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    5 Thread(s)

    Default Re: "Compile Error method data not found"

    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.

  9. #9
    New Member
    Join Date
    Feb 2014
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: "Compile Error method data not found"

    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

  10. #10
    New Member
    Join Date
    Feb 2014
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: "Compile Error method data not found"

    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
        .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 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

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •