Results 1 to 5 of 5

Thread: call form from another workbook

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Location
    England
    Posts
    21

    call form from another workbook

    Hi, can anyone help a struggling novice please?

    I want to call a form (frmDetails) in one workbook (Book1.xls) from another workbook (Book2.xls) but am struggling. I've done it from within the same workbook no problem.

    Any suggestions please.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    try replacing this: frmDetails

    with this: WorkBooks("Book1").frmDetails

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Location
    England
    Posts
    21
    Thanks for your suggestion si_the_geek.

    However I get an error message 438 'Object doesn't support this property or method'. I can't work out why!

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    ah ok, it isnt specifically a "child" of the workbook, you need to go thru the VB project too. I cant test it right now, but I think this (or something very similar) will work:

    WorkBooks("Book1").VBProject.VBComponents.Item("frmDetails").Show

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2002
    Location
    England
    Posts
    21
    Gave it a try, after getting a 1004 run time error (Method 'VBProject' of object '_Workbook' failed) I ticked the box for 'Trust access to Visual basic project' in Tools, Macro, Security and then I got the same error message as before (No.438).

    If you get time to test it out it would be much appriciated, no rush though, just glad of some help.

    Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width