Converting a spreadsheet to a standalone application

Hi All

I have developed a very complex business simulation (over several years) using Excel with some VB macros. I would now like to develop this as a standalone application (without the Excel branding). I have tried recreating the simulation as a Visual Studio project but the programming task is enormous without the benefit of cells, formulas, sheets, etc. that Excel is so good at.

Does anyone know of a software product that has the cell and formula functionality of Excel but with the form design, compiling and deployment features of Visual

Hope you can help.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Neil RussellTechnical Development LeadCommented:
I would only have one question...


If it works exactly as you want it to as an excel application, why would you now want to break away from what works well?
TerrygordonAuthor Commented:
The idea is to market the simulation commercially as a standalone application - not as an Excel workbook with all the limitations that this would place on it as a 'product' in its own right.
You wil need to use Excel Object to convert and
develop the application under Visual Basic.

Requires fairly minimal editing of modules
to run under VB environment.

Are you familiar with programming in VB?
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

TerrygordonAuthor Commented:
I'm familiar with VB, but not the Excel object. Currently using Visual Studio 2008.
byundtMechanical EngineerCommented:
For a single project, you may find it much easier to purchase a package like Calc4Web that takes your Excel spreadsheet and VBA macros--and converts it into C++ code that you can compile into a .exe application. In so doing, you retain "the benefit of cells, formulas, sheets, etc. that Excel is so good at."   

A free trial version is available.

byundtMechanical EngineerCommented:
If you want to use Calc4Web, you will likely need the Professional version. It's not cheap, but well worth it if you place a value on your time. There is a 30 day money back guarantee and a free trial version.      $2999 without maintenance     $3599 with maintenance for one year
TerrygordonAuthor Commented:
Hi Brad

It's getting pretty late over here (UK) so I will download the trial version tomorrow and have a look, before I award the points. Your solutions have always worked for me in the past, so I have no doubt that this one will too. Just have to construct another spreadsheet to figure out how many hours of my time adds up to $3,000!


Hi Terry!

 byundt has submitted a great idea.

However, Visual Studio 2008 should have everything you need to
compile the standalone .exe application on the fly, without any
additional cost.

Should you wish to consider the Excel Object idea further
please confirm  and I will submit a sample code example, for
you to build on.
TerrygordonAuthor Commented:
The code example for the Excel Object idea would be great (sorry for the delay in replying - I'm on UK time).


There is another well known and cheaper ($999) component
TerrygordonAuthor Commented:
Hi codecruiser

Unfortunately, the full license (for distributing the application to multiple users) is also $3,000 - the same as for Brad's suggestion.


Hi Terry!

This is  more of a VS6 thing but idea should work in VS2008 (imo)
(1) Open Executable VB project
(2) In object browser check Excel application object to
include it in your project(or help to find exact method).
(3) in form module enter code as below:
Private Sub My_Legacy_App()
Command1.Caption = "WORKING.."
Dim xlmod As Excel.Application
Set xlmod = New Excel.Application
'Open target file
'get_trk = App.Path & "\" & myfile.xls
get_trk = "C\" & myfile.xls
xlmod.Workbooks.Open FileName:=get_trk

'ActiveWindow.Caption = "My killer App" 'change caption
xlmod.Caption = "Brazil"        'change caption

'Do whatever you need to do here....

' When done code below to quit

'This section simulates file save,
'closes the Excel application,
'release the xlmod object, pop-up
'"Done" message and finally close kbut application
 xlmod.ActiveWorkbook.Saved = True
Set xlmod = Nothing
End Sub

Open in new window

Just fiddle around with idea and good luck with that!
Was rushing,

You will have to modify modules in original sheet
to refer to "xlmod" where necessary.
TerrygordonAuthor Commented:
Looks like the method is completely different in VS 2008. I will have a play and see what happens.
Clients using your VB executable App, might simply need to
have MS Excel installed on their machine. Still much cheaper than

Been a really long time since messing with that Excel object
and have not been doing too much with .NET framework, which
is too closely tied to Microsoft for me.
More than a few solutions exist here. The easiest way to go about it uses the Microsoft Excel Object library, or pure COM object returned from createObject function, with the former described the following MSDN article (

The Microsoft.Office.Interop library might also be of use, but either solution does not create a standalone application, per se, just automates Excel.

The third solution requires transforming the Excel VBA classes, modules, subroutines, and functions into VB.Net. Fortunately, this is somewhat easy because VB.Net is not so different. Most of the VBA syntax will likely work without conversion. A few pointers:

Wrap all Excel VBA classes in the following:

      Class MyClass
      End Class

      Module Module1
      End Module

2. use the Interop Library to call Excel or use a custom class for holding input data

3. If using Excel formulas, convert those into VB.Net functions

4. Display data using datagridview controls

5. Store and manage data using datatables, set this as the data source for your datagridview control.

6. Add handles to event-triggered procedures

Really  though, if you don't want a whole bunch of work, just automate Excel.
TerrygordonAuthor Commented:
Hi jdannemann

Some good ideas but automating Excel doesn't solve the basic problem of having a standalone application (the user still sees a spreadsheet that is clearly branded as Microsoft Excel).

I think I might be forced to go down the more expensive 'off the shelf software' route or just rebuild the whole thing as a VB application.


Hi Terry!

Sorry, I overlooked the Excel branding execption
in your question.

In that case it is a tweek more like pulling out a tooth.

However, you could try the "MSFlexGrid" object in
your VB project to simulate your own custom Excel
like spreadsheet. But you would need to define all
the property details.

Just drag the "MSFlexGrid" object onto a form
and set dimensions and properties as you desire.
Lots of help available or used to be available on
configuring "MSFlexGrid" object as custom spreadsheet.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TerrygordonAuthor Commented:
Hi All

I have decided to start from scratch in VS - looks like the only way I can get 'exactly' what I want. However, because you have all given valid comments I am dividing the points based on the amount of effort each expert has put in (seems like the fairest way). I hope this is acceptable and thanks again for your efforts.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.