Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling a spreadsheet

Status
Not open for further replies.

bpeirson

Structural
Apr 7, 2003
147
Has anyone ever attempted to compile a spreadsheet into a stand alone program?

Consider a sreadsheet with a considerable amount of VBA code, formulae and user forms. Items which are native to excel run quickly, functions added to the spreadsheet with VBA run slowly. If a person could compile the spreadsheet it stands to reason that the code code be optimised for speed during the compilation process and the compiled code would run faster than the VBA in any case.

I realise that an Excel spreadsheet and VBA "children" of the Excel environment but code is code. Excel acts as a realtime compiler for its children, why not develope a way for the children to grow up and live on their own.

 
Replies continue below

Recommended for you

You could compile the VBA code in VB and have the program run a session of Excel although my experience with SolidWorks (not an apple to apple comparison) is that the macro code runs several times faster than the VB compiled code unless it is made to be an add-in.

I would imagine there are many other ways in which you can accomplish what you want (maybe embedding a spreadsheet inside a VB form). I am still learning to use VBA with Excel so I have a lot to learn myself.

Regards,

Regg
 
The best case scenario for what I have proposed woyuld be that the new program would run independantly of Excel. It would be able to run on computers without Excel installed.

Compiling code from source code is merely a translation from something the programmer can understand to something the computer can understand. When a spreadsheet is examined by a compiler the compiler could create code to achieve the same result as the original part of the spreadsheet.

For my purposes the new program may not have an accessable spreadsheet component. As a concept the spreadsheet is merely a 2 dimensional array, therefore its contents could be held in an array. So as the compiler reviews a sreadsheet it could replace the spreadsheet with an array cell by cell.

Maybe a stepping stone is to compile the spreadsheet into source code for C# or some other language.

The overall advantage is that users familiar with Excel and VBA could develop software without learning an new programming language.
 
VB has the MSHFlexGrid control that may fit your needs.

Regards,

Regg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor