Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Go Back  Xtreme Visual Basic Talk > > > > Load XLL (Com-Addin) from memory, no physical files


Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2017, 01:26 PM
FCode FCode is offline
Newcomer
 
Join Date: Apr 2017
Posts: 1
Question Load XLL (Com-Addin) from memory, no physical files


Hi,

I'm working on an Excel AddIn to "replace" the VBA editor with a very similar C# based editor.
It provies an in-application IDE with which users ot the developer addin can write their C#-based addins. I'm transforming the user's code into a small ExcelDna-based COM-visible Addin, which is packed into the workbook.
You can then send around the workbook without any need for additional files; users can open this, without needing to have any addins installed whatsoever, and the workbook itself will extract the packed addin and register it, then call into its COM-exposed functions.

Works very well so far. But currently, I'm extracting the stored addin file (.xll) into the %temp% directory before loading it. This works well, but I'm contemplating if there's any reasonable way to achieve the same without needing to actually store anything on disk. Not least because I don't want to fill up the user's temp directory (each workbook extracts at least 1-2 MB of data), and properly cleaning up these files after use is a bit messy.

So, bottom line: Let's say I have all the data of my .XLL addin file as a byte() array in Excel. Is there any way how I could register this, without storing the data to disk?

My first idea was injecting the XLL library's data into Excel's process memory, then executing it from memory (via kernel32 / CreateThread) . I got a prototype of this working - but I've noticed some anti virus scanners really don't like this at all, and either the combination of injection+execution, or just the call to CreateThread triggered the AV software.
So I stopped working on this approach - even if I could somehow avoid detection for now, I'm not keen on a race against AV software, especially as this is intended to be legit software which needs to be usable now, and in the future, on a wide range of system setups.

Now I'm terrible at networking, and not sure this works at all, but my most recent idea: Would it be somehow possible to create a virtual drive via VBA that "somehow" maps into memory?
I've seen you can do some socket programming via WS2_32.dll, and I also know you can create virtual drives via VBA to e.g. network shares.
Again, I know very little about networking, but would it be somehow possible in VBA to host, say, a local (FTP I assume?) server that provides the file, and then map a drive against this?

And, in case that idea is complete nonsense, can anyone else think of a reasonable way to load a XLL purely from memory?

Thanks!
Reply With Quote
Reply

Tags
addin, memory, users, workbook, data, vba, file, xll, software, idea, virtual, create, disk, drive, reasonable, addins, .xll, directory, networking, createthread, files, load, editor, register, excel


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
 
Load XLL (Com-Addin) from memory, no physical files
Load XLL (Com-Addin) from memory, no physical files
 
-->