-2

I have a VBA EXE which is used in my document converting application and we deliver this to multiple clients and they never complained about any compatibility issue but now we are migrating the project to C#. So below are my doubts that i want to clear of first

  1. A EXE generated from C#.net to run at client system will need .NET framework to be setup at client system. So is there any way of achieving this with out setting up .NET framework
  2. How does VBA EXE run in almost any system with out framework to be installed for it
Albin Sunnanbo
  • 46,430
  • 8
  • 69
  • 108
  • Never heard of VBA being compiled into an executable.....are you sure it's VBA? – Tim Jul 16 '14 at 19:03
  • 1
    Most windows available on the market will come with either .net 2.0 or .net 3.5 depending on the OS so you should be fine if you target those versions, aside from that you could make a installer that does not depend on .net to install both your application and the targeted framework it needs to run. – Prix Jul 16 '14 at 19:05
  • NSIS has some pieces that are really great at building installers for handling exactly what Prix is talking about. – AaronLS Jul 16 '14 at 19:16
  • Yes it is not VBA but VB6. It was my mistake but thanks for all your replies – Midhunraj Rajan Thadathil Jul 17 '14 at 17:54

1 Answers1

1
  • The only way to do this that I know of is through static compilation using Mono or using commercial product. My understanding is this compiles the .NET framework into native code and includes it in your application(generally only the pieces you are actually using). This is probably territory for very experienced .NET developers. Even as a very experienced C# developer, I have never encountered a situation where the potential problems involved in doing this outweighs the cost of simply installing .NET. See: Static compilation in the .NET world

  • VBA == Visual Basic for Applications, and thus it only runs in the context of applicatiosn such as Excel or Word. You might be referring to VB such as VB 6, in which it is possible to compile to a native exe, which can be executed directly by the operating system because it is machine code. .NET on the other hand compiles to a language that is mostly machine agnostic, essentially deferring that last step of compilation to machine code until it is executed on the target machine, and thus the .NET framework must be installed on the target machine so that it can handle this last step. Additionally there are alot of benefits to having the .NET framework libraries externalized and shared: no duplicate deployment per application, security fixes not dependent on application author updating their side-by-side DLLs, etc. For understanding of machine code see: Assembly code vs Machine code vs Object code?

Community
  • 1
  • 1
AaronLS
  • 37,329
  • 20
  • 143
  • 202