+ Reply to Thread
Results 1 to 4 of 4

In Excel, why does my VB not work when launched from IE ?

  1. #1
    David C
    Guest

    In Excel, why does my VB not work when launched from IE ?

    I have a small VB project which works fine when launched by MSExcel, but
    fails when launched by hyperlink from a webpage (IE5).

    The file booking.xls opens 4 other xls files and copies data from them, but
    when launched from within IE, it opens the files OK but cannot then move
    focus to them in order to copy cells.

    Does IE require different ways of linking? I used workbooks.open (4 times)
    to find and open the subordinate files, then windows(bookname).activate plus
    sheets(sheetname) to switch to each of then in turn. When launched from IE,
    this produces a Run-time error '9' (Subscript out of range) - which I guess
    means that the bookname parameter is not picked up.

  2. #2
    Tom Ogilvy
    Guest

    RE: In Excel, why does my VB not work when launched from IE ?

    Are they being opened in separate instances of Excel when launched from IE
    and within the same instance when launched from MS Excel?

    --
    Regards,
    Tom Ogilvy



    "David C" wrote:

    > I have a small VB project which works fine when launched by MSExcel, but
    > fails when launched by hyperlink from a webpage (IE5).
    >
    > The file booking.xls opens 4 other xls files and copies data from them, but
    > when launched from within IE, it opens the files OK but cannot then move
    > focus to them in order to copy cells.
    >
    > Does IE require different ways of linking? I used workbooks.open (4 times)
    > to find and open the subordinate files, then windows(bookname).activate plus
    > sheets(sheetname) to switch to each of then in turn. When launched from IE,
    > this produces a Run-time error '9' (Subscript out of range) - which I guess
    > means that the bookname parameter is not picked up.


  3. #3
    David C
    Guest

    RE: In Excel, why does my VB not work when launched from IE ?

    In MSExcel they launch as 5 separate instances, whereas from IE they launch
    as one (the first) as xl within a IE window, and the other 4 all within a
    single Excel window. (weird eh? )

    I tried an intermediate xl sheet which just opens the first file; this gives
    the intermediate in IE and 5 within xl. AND (!) in this case, the first ends
    up as a hidden window. By manually uphiding this, it runs fine as expected.
    (weirder and weirder!)

    "Tom Ogilvy" wrote:

    > Are they being opened in separate instances of Excel when launched from IE
    > and within the same instance when launched from MS Excel?
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > "David C" wrote:
    >
    > > I have a small VB project which works fine when launched by MSExcel, but
    > > fails when launched by hyperlink from a webpage (IE5).
    > >
    > > The file booking.xls opens 4 other xls files and copies data from them, but
    > > when launched from within IE, it opens the files OK but cannot then move
    > > focus to them in order to copy cells.
    > >
    > > Does IE require different ways of linking? I used workbooks.open (4 times)
    > > to find and open the subordinate files, then windows(bookname).activate plus
    > > sheets(sheetname) to switch to each of then in turn. When launched from IE,
    > > this produces a Run-time error '9' (Subscript out of range) - which I guess
    > > means that the bookname parameter is not picked up.


  4. #4
    David C
    Guest

    RE: In Excel, why does my VB not work when launched from IE ?

    Curiously, I have discovered that linking to a shortcut works fine; what is
    that all about? When I open "Shortcut to <filename>.lnk" from IE5, I get the
    usual OPEN or SAVE options, and either way, it works properly.

    "David C" wrote:

    > In MSExcel they launch as 5 separate instances, whereas from IE they launch
    > as one (the first) as xl within a IE window, and the other 4 all within a
    > single Excel window. (weird eh? )
    >
    > I tried an intermediate xl sheet which just opens the first file; this gives
    > the intermediate in IE and 5 within xl. AND (!) in this case, the first ends
    > up as a hidden window. By manually uphiding this, it runs fine as expected.
    > (weirder and weirder!)
    >
    > "Tom Ogilvy" wrote:
    >
    > > Are they being opened in separate instances of Excel when launched from IE
    > > and within the same instance when launched from MS Excel?
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > >
    > > "David C" wrote:
    > >
    > > > I have a small VB project which works fine when launched by MSExcel, but
    > > > fails when launched by hyperlink from a webpage (IE5).
    > > >
    > > > The file booking.xls opens 4 other xls files and copies data from them, but
    > > > when launched from within IE, it opens the files OK but cannot then move
    > > > focus to them in order to copy cells.
    > > >
    > > > Does IE require different ways of linking? I used workbooks.open (4 times)
    > > > to find and open the subordinate files, then windows(bookname).activate plus
    > > > sheets(sheetname) to switch to each of then in turn. When launched from IE,
    > > > this produces a Run-time error '9' (Subscript out of range) - which I guess
    > > > means that the bookname parameter is not picked up.


+ 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