Consulting

Results 1 to 4 of 4

Thread: VBA Compiler broken?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Master
    Joined
    Feb 2011
    Posts
    1,480
    Location

    VBA Compiler broken?

    I've tested this in Office 365 and 2016... is this is some kind of fundamental change to the compiler, or have I just missed this bug all these years?
    Sub Test1
    Dim p As Paragraph
    
    
    Set p = Selection.Paragraphs.First
    Test2 p.Range
    End Sub Sub Test2(p as Paragraph) Debug.Print p.Range.Text End Sub
    Why does that only provoke a run-time error of type mismatch? Shouldn't it provoke a compile error?
    Last edited by Bob Phillips; 07-29-2019 at 06:38 AM. Reason: Formatting
    _______________________________________________
    Please don't cross-post without providing links to your cross-posts. We answer questions for free. Please don't waste the time of the people helping you.
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

    - Frosty

Posting Permissions

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