+ Reply to Thread
Results 1 to 12 of 12

Compiling and Publishing an Excel VBA application

  1. #1
    Registered User
    Join Date
    12-06-2020
    Location
    Stittsville, Ontario
    MS-Off Ver
    2007
    Posts
    6

    Compiling and Publishing an Excel VBA application

    I wrote a VBA application in Excel 2007 which I would like to make available for free to anybody who wants it, but I'd like to compile it as a standalone application rather than requiring Excel to be installed on the user's computer. If that's not feasible I would settle for a compiled version that requires Excel. The free compiler available on the Internet came with a nice Trojan virus which I had to eradicate from my system so I'm a little leery of trying that again and I don't have hundreds of dollars to buy a full featured compiler just for this project. The application is a game the whole family can enjoy, especially during this God forsaken pandemic. I have no real interest in profiting from this work as it was a learning experience for me and a lot of fun to write. Does anyone have any suggestions or perhaps someone can direct me to the right forum?

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Compiling and Publishing an Excel VBA application

    are you aware that, by definition, VBA is a language that only works with office applications? it's not a universal language. its object model is meant for office programs only. per it's definition alone. the only way you could make your "game" work in any other environment is if you are using universal programming concepts that every language uses. but I doubt you're doing that. for instance, if you're doing anything like this at all:
    PHP Code: 
    userform1.show 
    obviously that's going to look at the excel forms collection and try to call the userform inside the compiled application. and the userform statement can't possibly by read, by, say, an Oracle interface program. See what I mean? I might be mistaken, or I might have worked a little too much today, but I think what I'm saying is accurate. if it's not, surely someone else here will chime in and correct me.

    either that, or you have not provided enough information with regard to what you've tried to do by writing a simple program in a language of your choice.

  3. #3
    Registered User
    Join Date
    12-06-2020
    Location
    Stittsville, Ontario
    MS-Off Ver
    2007
    Posts
    6
    There are compilers for Excel VBA that take all of the necessary functions and libraries from Excel that your application needs to run without requiring Excel to be installed on the users system. They're just too expensive for my purpose. Thought maybe there might be a cheaper way to do it
    Last edited by 6StringJazzer; 12-06-2020 at 11:00 PM. Reason: Please do not quote an entire post just to respond to it

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Compiling and Publishing an Excel VBA application

    hmmmmm....then obviously I was a little off in my words. perhaps too much work. LOL. but what you said really has nothing to do with what I was talking about. If you post a screenshot of the interface you created for your game, I can clarify what I said.

  5. #5
    Registered User
    Join Date
    12-06-2020
    Location
    Stittsville, Ontario
    MS-Off Ver
    2007
    Posts
    6

    Re: Compiling and Publishing an Excel VBA application

    Okay, I did a bit more digging and it seems it is not possible to create a standalone EXE
    application using any kind of compiler to convert Excel VBA code. I was sure I had seen such
    a compiler available some years ago. Either I misinterpreted the compiler's abilities or, I was dreaming LOL.

    Okay, then my only option is to create an EXE that can run on a system that already has Excel installed. My next
    question is, will my Excel 2007 code work on a later version of Excel? Is Excel backwards compatible that way?
    Last edited by UncleJink; 12-06-2020 at 11:08 PM. Reason: Want to remove the attachment

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Compiling and Publishing an Excel VBA application

    Quote Originally Posted by vba_php View Post
    but what you said really has nothing to do with what I was talking about.
    That is true, but your post, though factually accurate, was not responsive to the OP, and does not move towards a solution. If you search for Excel compilers you will find at least a couple of products on the market that will generate a portable .exe file from an Excel file. The ones I found were around $150 or so. I tried one on a free trial basis a couple of years ago and it worked in a limited test. The question is, "Is there an alternative to costly products to do exactly the same thing?"

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Compiling and Publishing an Excel VBA application

    Quote Originally Posted by UncleJink View Post
    will my Excel 2007 code work on a later version of Excel? Is Excel backwards compatible that way?
    It should certainly work on a later version of Excel. I am not aware of any features in 2007 VBA that were deprecated in later versions. However, if you have written your code on a 32-bit version of Office, you will run into trouble trying to run it in a 64-bit version. There are ways to prevent that if you anticipate it.

    It may not work in earlier versions of Excel, depending on whether you are using WorksheetFunctions in your code or exceeding worksheet size limits of earlier versions.

  8. #8
    Registered User
    Join Date
    12-06-2020
    Location
    Stittsville, Ontario
    MS-Off Ver
    2007
    Posts
    6

    Re: Compiling and Publishing an Excel VBA application

    I'm not a usual poster in these type of forums so you'll have to educate me as to what an OP is.
    I thought my question was pretty straight forward. I was under the impression one could convert Excel VBA code into a standalone application that did not require Excel to run. What I read in the past was that the compiler would extract all necessary functions and libraries from Excel and embed them in the EXE along with the VBA code. As I later explained, further reading on the subject would contradict my assumption, so that idea went out the window. I started programming in GW Basic as a kid then moved to Xbase languages such as Clipper and Foxpro then onto C++ so I understand the idea of compiling code to EXE. I just thought I could do the same with Excel VBA. Maybe I'm just too old now to grasp it all. The brain isn't what it used to be.

  9. #9
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Compiling and Publishing an Excel VBA application

    Quote Originally Posted by 6StringJazzer View Post
    That is true, but your post, though factually accurate, was not responsive to the OP, and does not move towards a solution.
    it wasn't meant to move towards a solution. and Ali will probably slap me for saying that. it gives information, and most of the time the info I give does help to some degree. at least that's what some tell me. if it doesn't oh well. no way for me to know unless they say something.

    Quote Originally Posted by UncleJink View Post
    you'll have to educate me as to what an OP is.
    original poster.

    Quote Originally Posted by UncleJink View Post
    What I read in the past was that the compiler would extract all necessary functions and libraries from Excel and embed them in the EXE along with the VBA code. As I later explained, further reading on the subject would contradict my assumption, so that idea went out the window.
    pretty much. see here: https://en.wikipedia.org/wiki/Compiler

    I have no doubt that some compilers can serve a purpose of transforming libs meant for excel to something else. after all, everything is just numbers anyway. per the page:
    The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language, object code, or machine code) to create an executable program
    in your case, VBA is high, machine code is low. again, per another article on the same site: https://en.wikipedia.org/wiki/Executable

    VBA code, when run by the excel application, has to be parsed. that's why you get a run time error if you write this:
    Please Login or Register  to view this content.
    without the end if. the interpreter (coding environment) parses the statement by identifying the ''if'' block statements.

    Quote Originally Posted by UncleJink View Post
    Maybe I'm just too old now to grasp it all. The brain isn't what it used to be.
    i seriously doubt that. you already know more than most that are 20-30 years old and in their prime. LOL.

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Compiling and Publishing an Excel VBA application

    You are talking about language compilers but UncleJink is talking about a product that is typically called an "Excel compiler" but is not a compiler in the usual sense and is not merely a VBA compiler. A discussion about how VBA is executed by an interpreter doesn't apply to how to distribute an entire Excel application, which consists of the VBA plus everything else in the file.

    One example of an Excel compiler is DoneEx. I am not endorsing the product and have not used it, only holding it up as an example. The cheapest license is $150. Features:

    • Protect spreadsheet formulas by converting them into binary format.
    • Compile Excel workbook (XLS, XLSX, XLSM, XLSB files) into an application (EXE File, which requires Excel to run). You do not need to be a programmer to use the product!
    • VBA code protection. VBA copy protection blocks access to the VBA project (as it makes VBA project unviewable), and hides the VBA code, thereby disabling VBA debug mode. By applying the VBA code modification options, such as ‘Obfuscation’ and ‘Literals Removing’, you will get modified VBA code, which will not work outside of the compiled application.
    • Compile workbook into an EXE that is compatible with both 32 bit and 64 bit Excel versions.
    • All versions from Microsoft Excel 2007 SP3 and higher (2010, 2013, 2016, 2019) are supported. Microsoft Excel as a part of Office 365 is supported.
    • Customize or localize (translate the language to your customer’s native language) the compiled workbook messages.
    • Run a compiled workbook without a macro security alert.
    • Create a registration key/license based application, preventing it from being illegally copied from one computer to another.
    • Workbook copy protection with hardware locking! This allows your protected workbook to work only on the targeted computer.
    • Royalty-free distribution of your compiled EXE, which doesn’t require any pre-installed run-time libraries.
    • Workbook copy protection with a hardware dongle (USB stick).
    • The original Excel workbook remains unchanged after compilation.
    • Restrict the time period of the usage for your protected workbook.
    • License expiration warning. Add your own customized expiration message.
    • Add your own End User License Agreement (EULA) . The compiled Excel workbook will not be started until the end user accepts the EULA.
    • Save changed data directly into the compiled EXE file or into secured external data storage.
    • Create a Trial/Demo version of your protected workbook with adjustable trial period and custom “nag” window.
    • Hide Microsoft Excel on start.

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Compiling and Publishing an Excel VBA application

    BTW UncleJinks, the Excel compilers I looked at all require Excel to be installed to be able to run them, as seen above in the second bullet.

  12. #12
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Compiling and Publishing an Excel VBA application

    Quote Originally Posted by 6StringJazzer View Post
    BTW UncleJinks, the Excel compilers I looked at all require Excel to be installed to be able to run them, as seen above in the second bullet.
    and that's obviously no surprise.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Publishing Excel as a Webpage
    By mattkerr in forum Excel General
    Replies: 1
    Last Post: 03-02-2019, 02:19 AM
  2. Publishing Excel Workbook to the Web
    By laffers in forum Excel General
    Replies: 0
    Last Post: 07-08-2010, 06:26 AM
  3. publishing excel to the web
    By namrekka in forum Excel General
    Replies: 1
    Last Post: 04-02-2006, 12:35 AM
  4. [SOLVED] Publishing Excel through IIS
    By Julian in forum Excel General
    Replies: 0
    Last Post: 03-09-2006, 04:35 AM
  5. Publishing my excel workbook on the web
    By SG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2006, 08:00 AM
  6. Compiling Excel 2003 application written in VBA 6.0 Code
    By Heinzpeter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-07-2005, 03:05 PM
  7. [SOLVED] Web Publishing from Excel
    By David in forum Excel General
    Replies: 0
    Last Post: 07-28-2005, 07:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1