error with excel 2007 and FileStream (but not with excel 2003)

Last post 06-27-2009 8:11 AM by tartuffe2. 0 replies.

Sort Posts:

  • error with excel 2007 and FileStream (but not with excel 2003)

    06-27-2009, 8:11 AM
    • Member
      144 point Member
    • tartuffe2
    • Member since 06-28-2006, 6:15 AM
    • Posts 433

     Hi,

    until today, i used excel 2003 with FileStream and everything worked.
    Now i installed excel 2007 and i changed the extention in the code to .xlsx,
    but now i get the error:
    "the file xyz couldn't be open because the format is wrong etc ..."
    (translated)

    my code:

    Dim objFileStream As FileStream
    Dim objStreamWriter As StreamWriter
    ...
      objFileStream = New FileStream(fileName, FileMode.OpenOrCreate,
    FileAccess.Write)
      objStreamWriter = New StreamWriter(objFileStream)
      objStreamWriter.WriteLine("This must be sent to excel"
      objStreamWriter.Close()
      objFileStream.Close()

    I suspect i have to install a more recent driver for excel 2007?

    Thanks
    Tartuffe

Page 1 of 1 (1 items)