Simple question I think

Mar 6, 2014 at 9:59 AM
Edited Mar 6, 2014 at 10:01 AM
Write data to specific Excel file.

Hello, I have a simple question, I think..

How do I write my data from "fields" to a specific excel file..

for Word I do:

object doc = Word.GenerateDocument(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\Lidmaatschapskaart.dotx", this.Ledens.SelectedItem, mapContent);
// Export het document naar Word.
        Word.Export(doc, "Lidmaatschapskaart", 2, false, this.Ledens, mapContent);
But this doesn't work for Excel.

here's my code:

partial void Printen_Execute()
    {
        //Export a specific set of Book fields to a new workbook
        var fields = new List<String> { "Voornaam", "Adres" };

        OfficeIntegration.Excel.Export(this.Ledens, fields);
    }
Can someone help me, please?

Mark
Mar 6, 2014 at 12:26 PM
I just figured it out myself!

OfficeIntegration.Excel.Export(this.Ledens, @"C:\test.xlsx", "Sheet1", "C1");

Mark
Marked as answer by somarkie on 3/6/2014 at 5:26 AM