Results 1 to 3 of 3

Open Workbook With VB .NET

Threaded View

  1. #1
    Registered User
    Join Date
    09-04-2008
    Location
    Madrid, Spain
    Posts
    8

    Open Workbook With VB .NET

    Hi everybody.
    I opened a thread some days ago because I was trying to break all the links a workbook could have with a program developed on VB.NET.
    I received an answer but I couldn't try that yet, because I just can't open any workbook, the error I get says that "The server returned an error".
    I have been looking on different forums, searching the internet, there are different ways to open a file, but it seems impossible to me.

    First of all, I included the reference to Excel...
    "Microsoft Excel 11.0 Object library", I'm working with Office 2003.
    Then, I use this code, for example:

    Dim oExcel As Object
            Dim oBook As Object
            Dim oSheet As Object
            Dim path As String
            path = "C:\Workbook.xls"
    
            oExcel = CreateObject("Excel.Application")
            oBook = oExcel.Workbooks.open(path)  'This is the line where I get the error
    The error I get says (I'll translate it, but I suppose you'll get it)
    "Exception not controlled type: System.Runtime.InteropServices.COMException on Microsoft.visualbasic.dll
    Additional information: Server launched an exception

    Thanks a lot!!
    Last edited by dominicb; 09-10-2008 at 05:10 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Open XLS files in a new Workbook
    By shaught in forum Excel General
    Replies: 0
    Last Post: 05-21-2008, 09:59 AM
  2. How to tell if a workbook is open
    By suburbanght in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2007, 11:12 AM
  3. Open workbook in a macro letting the user choose the workbook
    By russ8502 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2007, 03:10 PM
  4. how to get data from saved workbook that is also currently open?
    By seron in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2007, 02:23 PM
  5. Open a New Workbook
    By Lvenom in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-27-2007, 02:54 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