+ Reply to Thread
Results 1 to 4 of 4

My code is jumping workbooks

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    My code is jumping workbooks

    I have the following code in ThisWorkbook Object:
    Please Login or Register  to view this content.
    A user had the workbook containing this code open.
    Then opened a workbook from a customer which contained NO code.
    Upon trying to close the customer's workbook she was given the message "Blank Row are not allowed before closing please delete Row(s): "

    She closed our workbook containing this code, and then was able to close the customer's workbook.

    Why would the code in ThisWorkbook apply itself to another workbook?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    All unqualified range references refer to ranges on the activesheet of the activeworkbook.

    You should qualify references with ThisWorkbook.SheetX.Range(whatever), where SheetX is the code name (the name seen in the Project Explorer window) for the worksheet.

  3. #3
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686
    why would sheet code or workbook code refer to anything other than the sheet or workbook it is in?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    It would be pretty limited in versatility if it couldn't. There would be no such thing as add-ins, for example.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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