+ Reply to Thread
Results 1 to 2 of 2

Personal workbook opens and messes up workbooks(i)

  1. #1
    Mark Stephens
    Guest

    Personal workbook opens and messes up workbooks(i)

    I am referring to workbooks by number (I open a workbook and then refer to
    it as workbooks(2). Problem is that when I refer to it, it refers to an
    invisible workbook that is opening (personal) without my volition. Can
    anyone tell me hwat's going on?

    Thanks in advance, kind regards, Mark



  2. #2
    Dave Peterson
    Guest

    Re: Personal workbook opens and messes up workbooks(i)

    I don't think I'd ever trust the index into the workbooks collection.

    I'd use a variable (or two):

    dim ActWkbk as workbook
    dim otherWkbk as workbook

    set actwkbk = activeworkbook
    set otherwkbk = workbooks.open(filename:=.....)

    ....

    then you can do anything you want by using that variable:

    otherwkbk.save
    otherwkbk.close savechanges:=false




    Mark Stephens wrote:
    >
    > I am referring to workbooks by number (I open a workbook and then refer to
    > it as workbooks(2). Problem is that when I refer to it, it refers to an
    > invisible workbook that is opening (personal) without my volition. Can
    > anyone tell me hwat's going on?
    >
    > Thanks in advance, kind regards, Mark


    --

    Dave Peterson

+ 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