+ Reply to Thread
Results 1 to 5 of 5

Issues with opening or closing of a workbook

  1. #1
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Issues with opening or closing of a workbook

    Hi all

    wanted to ensure user enters some value in range("A1") for the workbook to be closed.

    The workbook should be open until some value is updated a1. I have tried with wb.open , close it
    doesnt give me the result . Below is the code

    Please Login or Register  to view this content.
    Never confuse a single defeat to the final defeat.

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Issues with opening or closing of a workbook

    You need to use a workbook before close event.

    Place this code in "ThisWorkbook" module, not a normal module. And change MySheet to your worksheet name.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Issues with opening or closing of a workbook

    Not sure to have a clear understanding of what you want versus the code you propose but try

    In a module put
    Please Login or Register  to view this content.
    in Thisworkbook module put
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Re: Issues with opening or closing of a workbook

    Thank you PCI, Ptmuldon for your help

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Issues with opening or closing of a workbook

    You're welcome and thx for the rep ...!

+ 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] How to get password prompt again without closing and re-opening workbook
    By Monimonika in forum Excel General
    Replies: 3
    Last Post: 10-14-2016, 07:41 AM
  2. Opening A 2nd Workbook to Retrieve Data From then Closing that Workbook
    By ddevries03 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2016, 05:04 PM
  3. Replies: 1
    Last Post: 10-23-2014, 10:59 AM
  4. Opening and closing workbooks using userform button issues!!
    By BuenosDias in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-13-2014, 11:04 AM
  5. [SOLVED] How to clear the value of one cell upon opening or closing the workbook.
    By JET2011 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2013, 09:00 AM
  6. Opening and closing one workbook after another
    By Nancy123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-21-2010, 08:37 AM
  7. Opening/Closing a Workbook(s) in Excel 2007
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-08-2007, 03:37 AM

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