+ Reply to Thread
Results 1 to 3 of 3

C# creating workbook

  1. #1
    Registered User
    Join Date
    11-01-2010
    Location
    Amsterdam, the Netherlanda
    MS-Off Ver
    Excel 2003
    Posts
    1

    C# creating workbook

    Hi,

    I'm writing an app, that amongst other things lets users export data to an Excel file.
    When I create the file using my current locale "nl-NL" using this code:
    xlApp = new Excel.ApplicationClass();
    xlWorkBook = xlApp.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);

    I get this error:

    "Old format or invalid type library. (Exception from HRESULT: 0x80028018
    (TYPE_E_INVDATAREAD))"

    Searching on internet revealed that changing the locale to en-us by this code fixes the problem.
    CultureInfo cult = new CultureInfo("en-US");
    Thread.CurrentThread.CurrentCulture = cult;

    Can anyone enlighten me to how this could be related to locale?

    cheers,
    Csharper
    Last edited by Csharp; 11-01-2010 at 11:00 AM. Reason: essential info not included

  2. #2
    Registered User
    Join Date
    09-14-2013
    Location
    dubai
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: C# creating workbook

    Here you can find complete c# excel automation help http://csharp.net-informations.com/e...l-tutorial.htm c# excel automations

    Steve

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: C# creating workbook

    Apparently it's a recognised bug http://support.microsoft.com/default...b;en-us;320369.
    If posting code please use code tags, see here.

+ 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