Thanks Thanks:  0
Likes Likes:  0
Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: How to open UserForm code by VBA?

  1. #21
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-22 01:49, Dave Hawley wrote:
    Hey! My shot in the dark wasn't that far off then!

    Go Ivan!


    Actually it was your shot in the dark that
    got me thinkin along this line where as I
    was on another tack with App.Goto Ref etc.

    Thanks Dave

    Ivan

  2. #22
    MrExcel MVP
    Colo's Avatar
    Join Date
    Mar 2002
    Location
    Kobe, Japan
    Posts
    1,456
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)

    Default

    U wont to know what is written in Userform1?
    Please try This!

    Sub test()
    With ThisWorkbook.VBProject.VBComponents("UserForm1").CodeModule
    MsgBox .Lines(1, .CountOfLines)
    End With
    End Sub

    Sub test2()
    ThisWorkbook.VBProject.VBComponents("UserForm1").CodeModule.CodePane.Show
    End Sub

  3. #23
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks dudes, you're awesome! I knew I could trust you on this one.

    I actually do know what's written in the UserForm, I'm just working on this "Advanced VBE" type of thing and couldn't get pass that UserForm thing. Well now I can, so thanks again!

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

    Default Re: How to open UserForm code by VBA?

    hi,
    i tried to use first one code sub test().
    it worked but i think it only showing till 1 page max.
    is there any way to print full code in pdf or in notepad or in word?
    will this work even if userform1 is password protected?
    thanks in advance.
    Abhisekh

    Quote Originally Posted by Colo View Post
    U wont to know what is written in Userform1?
    Please try This!

    Sub test()
    With ThisWorkbook.VBProject.VBComponents("UserForm1").CodeModule
    MsgBox .Lines(1, .CountOfLines)
    End With
    End Sub

    Sub test2()
    ThisWorkbook.VBProject.VBComponents("UserForm1").CodeModule.CodePane.Show
    End Sub
    Last edited by trustmeasfrnd; Feb 24th, 2018 at 09:41 AM.

Some videos you may like

User Tag List

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
  •