+ Reply to Thread
Results 1 to 2 of 2

Excel VBA from an Internet Explorer Browser

  1. #1
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Excel VBA from an Internet Explorer Browser

    I am needing to develop an application that will be a document on our company intranet. On the opening worksheet, the user will select desired criteria, then click a "Run Report" button. The VBA code will then open a .csv file and produce criteria-based reports. I've done extensive Excel VBA coding in my career, but have no experience with running it from within a browser, which is how it appears when you open the workbook from the intranet link. Code that works from Excel does not work from the browser. The first line of code I tried was "Workbooks.Open filepathname", and it gets Run-time error 1004: Method 'Open' of object 'Workbooks' failed. Is there a different set of code needed when running Excel VBA from a browser? What other problems and differences am I going to run into? Any guidance would be appreciated.

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Excel VBA from an Internet Explorer Browser

    I have a partial solution, but it needs some tweaking. To get it to run from Excel instead of from the browser, do the following:
    1. Open My Computer or a Windows Explorer window.
    2. Select File Types
    3. Type or Select XLS (or whichever extension the workbook has that you will be opening).
    4. Click Advanced.
    5. Uncheck "Browse in Same Window" and click OK.

    It will then open the document as a spreadsheet. However, this has to be done on each PC that will be using the document. That's fine for my situation, but I can't come up with a way, from the VBA code, to determine which way they have opened it. If they open from the browser, it still gets the run-time error when they run the report. If I could at least detect and produce a clean error message, I'd be happy, but I've found no property or way of determining the situation. Application.Name or Application.Parent both contain "Microsoft Excel", and it ignores the On Error statement I put in front of the Open. Any ideas?

+ 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