vb.net - Can an excel file be created/manipulated using Office developer tools? -
my current console application project uses office.interop.excel create , update excel files. project being upgraded , moving new servers office not installed.
i have seen many questions asking creating excel files without office installed , saw many answers use epplus, closedxml etc. curious see whether excel file can created using office developer extensions?
if yes, provide me example?
my current application's code similar below. removed of code , below code not compiled. shown give idea.
imports excel = microsoft.office.interop.excel public class myexcelclass private sub export() dim workbooks excel.workbooks = exc.workbooks dim myarraylist = getdata() 'records in arraylist dim workbook excel.workbook = workbooks.add(excel.xlwbatemplate.xlwbatworksheet) ''one sheet dim sheets excel.sheets = workbook.worksheets dim worksheet1 excel.worksheet = ctype(sheets.item(1), excel.worksheet) if worksheet1 nothing writelog("error: worksheet1 == null") exit sub else worksheet1.name = "my excel sheet" end if ''create 1 sheet me.createsheet(worksheet1, 1, myarraylist) ''save spreadsheet! dim sfilename string = "c:/1.xlsx" workbook.saveas(sfilename) try exc.quit() exc = nothing catch ex exception 'ignore end try end sub private sub createsheet(byref sheet excel.worksheet, byval isheetid integer, byval myarraylist arraylist) sheet .range("a1:z10000").font.size = 10 '.... more code range set alignment etc. '.... manipulate arylrecords , modify sheet end 'with sheet end sub end class
by "offic developer extensions" assume mean vsto , possibly newer javascript apis. these both technologies interacting user inside office application interface. 1) don't work in server environment , 2) require licensed installation of office.
from microsoft/visual studio side office open xml file formats designed creating office documents in server environment , open xml sdk "developer friendly" way it. have performance issues when comes large excel workbooks, however.
i imagine tools mention leverage ooxml file format, although i'm not familiar them.
one place discuss tools , approaches working open xml file formats openxmldeveloper.org.
Comments
Post a Comment