+ Reply to Thread
Results 1 to 4 of 4

workbook.open throws 1004 error

  1. #1

    workbook.open throws 1004 error

    Here is the entire application which generates the error:

    Sub bob2()
    Dim owb As Workbook
    Set owb = Workbooks.Open("C:\temp\test-import-data.xls")
    End Sub

    Can't get much more stripped down than that. I can open
    test-import-data.xml just fine in Excel but when I execute this functon
    I get 1004 "Application-defined or object-defined error". The file is
    created via an output from Siebel. But it is in Excel format. We are
    using Excel 2003.

    Any ideas?

    If I open up the excel document it will automatically close it when I
    call the open and still throw the errors.


  2. #2
    Gary''s Student
    Guest

    RE: workbook.open throws 1004 error

    Are you sure your file is O.K.?

    I copied your path, filename, and code and it worked on my machine (Win-XP,
    Excel-XP)

    So your code (probably) is not buggy.
    --
    Gary's Student


    "[email protected]" wrote:

    > Here is the entire application which generates the error:
    >
    > Sub bob2()
    > Dim owb As Workbook
    > Set owb = Workbooks.Open("C:\temp\test-import-data.xls")
    > End Sub
    >
    > Can't get much more stripped down than that. I can open
    > test-import-data.xml just fine in Excel but when I execute this functon
    > I get 1004 "Application-defined or object-defined error". The file is
    > created via an output from Siebel. But it is in Excel format. We are
    > using Excel 2003.
    >
    > Any ideas?
    >
    > If I open up the excel document it will automatically close it when I
    > call the open and still throw the errors.
    >
    >


  3. #3
    Jim Cone
    Guest

    Re: workbook.open throws 1004 error

    ..xls or .xml ?
    --
    Jim Cone
    San Francisco, USA
    http://www.realezsites.com/bus/primitivesoftware


    <[email protected]>
    wrote in message
    Here is the entire application which generates the error:

    Sub bob2()
    Dim owb As Workbook
    Set owb = Workbooks.Open("C:\temp\test-import-data.xls")
    End Sub

    Can't get much more stripped down than that. I can open
    test-import-data.xml just fine in Excel but when I execute this functon
    I get 1004 "Application-defined or object-defined error". The file is
    created via an output from Siebel. But it is in Excel format. We are
    using Excel 2003.
    Any ideas?
    If I open up the excel document it will automatically close it when I
    call the open and still throw the errors.


  4. #4

    Re: workbook.open throws 1004 error

    No, the file isn't okay . The export from Siebel has a sheetname of
    ..csv)output(1). This seemed okay at first as there is nothing super
    special about this sheetname (though it is bad to begin with). Looking
    deeper we found that the actual sheetname was .csv]output(1). Excel
    seems to be too smart for it's own good and displays a fixed version of
    the name but saving the file kept the "]" in the sheetname.

    We edited the binary, changed ] to ) and it loaded. Magic... Well,
    the problem is Seibel still exports the wrong thing and I doubt I will
    get our developers to fix this.

    Our next step is to write a piece of code to always open the file and
    edit the binary before importing the data. It's dirty work, and by far
    the wrong approach, but it's the best we have unless someone else has
    some additional 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