c# - Modify file embedded in Class Library then Save file -
i've been researching couple weeks , having hard time figuring out solution, hoping gain insight posting general question here.
i have class library (in case .xll) have embedded resource (a .xlsm). may or may not know, .xlls associated excel when opens .xll loaded instance of excel. in scenario when .xll loaded excel .xll loads re-create of embedded .xlsm. far good. allows me send out that, intents , purposes, appears unusual excel file end users @ workplace.
the problem comes in when user wants able save changes have made excel sheet. if save desktop (using excels built in save function) saved .xlsm. when .xlsm opened 1 time again .xll no longer loaded , .net features included in .xlsm not function.
a couple questions arise @ point. firstly, why not register .xll system? because if registered .xll every time opens excel .xll open, means embedded .xlsm open (remember, that's .xll on start up.) users tend find annoying... :-).
nextly, why not send both files? answer: much disruption end user (just bear me on this). love or hate it, want 1 file open , modify. them .xll version of .xlsm, , prefer retained perception makes explaining myself much easier.
lastly, why not distribute .xll grouping whole , release .xlsms against that? answer: these .xlls sent whole bunch of random places can't command user have on machine, prefer maintain things self contained.
there 2 basic solutions come mind.
option one figure out how recompile .xll on fly .xlsm (probably via instance of .xll), , save .xll place of users choosing. require me create own save method since excel won't help , include me needing intercept effort user makes @ saving can redirect them own save method. problem can't figure out how create .xll recompile itself, since i'll sending .xll out machines don't have sdk on them. , on top of that, forcing user utilize own save method unwelcome disruption (at to the lowest degree in opinion...)
option two create assembly works executable. contain .xlsm .xll , executable load excel , apply .xll it. long executable doesn't need admin privileges, think i'll fine sending them out in place of regular old file (most people around here never see extension anyway, right icon, people can't tell difference). problem can't figure out how link .xlsm assembly without using resource file , turning .xlsm bytecode. puts @ square one.
in essence, alternative 1 requires me figure out how compile on foreign machine , alternative 2 requires me figure how contain whole .xlsm can modify , place was...or @ to the lowest degree putting somewhere executable can find 1 time again easily.
anyway, if made far have eternal gratitude. i'm stuck trying figure out next , hoping can point me in right direction.
thanks in advance.
c# .net excel-dna
No comments:
Post a Comment