+ Reply to Thread
Results 1 to 8 of 8

Opening and closing workbooks using userform button issues!!

  1. #1
    Registered User
    Join Date
    07-07-2014
    Location
    Cornwall, UK
    MS-Off Ver
    MS Office 2013
    Posts
    30

    Opening and closing workbooks using userform button issues!!

    Right... So I have an issue...

    What I was hoping to do was the create a user form that when you press a button it closes the workbook (GARY VBA) that it is in and opens another ((Setting Notes)that in turn displays a userform on opening)...

    The opening of the secondary workbook occurs however the initial workbook (GARY VBA) doesn't not "close" until you do something on the initially displayed user form in the secondary work book (Setting Notes)...

    I have displayed the code that I have written for said button below but cannot get it to work as I described...

    Please Login or Register  to view this content.
    Any help would be great!!!

    Thanks in advance.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Opening and closing workbooks using userform button issues!!

    Please Login or Register  to view this content.
    Try removing the red lines.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Opening and closing workbooks using userform button issues!!

    Shouldn't you be unloading the userform in the initial workbook?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    07-07-2014
    Location
    Cornwall, UK
    MS-Off Ver
    MS Office 2013
    Posts
    30

    Re: Opening and closing workbooks using userform button issues!!

    I have rejigged my code using your advice but it still doesn't work...

    This time the new file doesn't open however the old one does close...

    Please Login or Register  to view this content.

    Have I got the...

    Please Login or Register  to view this content.
    in the wrong place?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Opening and closing workbooks using userform button issues!!

    Try moving the code to open the workbook to the bottom of the sub.

  6. #6
    Registered User
    Join Date
    07-07-2014
    Location
    Cornwall, UK
    MS-Off Ver
    MS Office 2013
    Posts
    30

    Re: Opening and closing workbooks using userform button issues!!

    Have altered code to...
    Please Login or Register  to view this content.
    However it still doesn't work, initial workbook closes however secondary doesn't show/open...
    Have checked and it is not due to it being "hidden"...

    Cheers

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Opening and closing workbooks using userform button issues!!

    What do you mean by 'secondary'?

  8. #8
    Registered User
    Join Date
    07-07-2014
    Location
    Cornwall, UK
    MS-Off Ver
    MS Office 2013
    Posts
    30

    Re: Opening and closing workbooks using userform button issues!!

    Sorry I meant secondary work book (Setting Notes.xlsm)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help with opening and closing workbooks
    By LaffyAffy13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2013, 10:55 AM
  2. Opening, Closing, and Opening Excel workbooks from MS Project
    By m007schneider in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 03:22 PM
  3. Closing / Opening Workbooks
    By AMK4 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-01-2007, 05:04 PM
  4. Opening and Closing workbooks in code
    By Francis Brown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-26-2005, 10:15 AM
  5. [SOLVED] Late Binding issues when closing workbooks
    By HeatherO in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 04-01-2005, 02:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1