Open an Excel Addin in C# -
i inherited c# windows application builds big spreadsheet display user. enhancement add existing excel add-in spreadsheet. have been trying add add-in once spreadsheet has been completed in code this:
excelapp.visible = true; // trying add add-in string workbookpath = @"c:\addiniwasgiven.xls"; workbook excelworkbook = excelapp.workbooks.open(workbookpath, 0, false, 5, "", "", false, xlplatform.xlwindows, "", true, false, 0, true, false, false);
whenever this, error: "cannot open microsoft excel add-in editing. please edit source document instead". unsure why getting error. see excelworkbook comes "c:\addiniwasgiven.xls", read how debugger showing it. i'm new add-ins , c#. suggestions or appreciated.
with , trial , error, found worked:
string workbookpath = @"c:\addin.xla"; workbook excelworkbook = excelapp.workbooks.open(workbookpath, 0, false, 5, "", "", false, xlplatform.xlwindows, "", false, false, 0, true, false, false);
add-in files should have .xla
or .xlam
extension. set workbook.isaddin=true
saving .xls
file excel add-in .xlam
Comments
Post a Comment