如何将Excel VBA宏转换为EXE文件? [英] How can I convert my Excel VBA Macros to EXE File?

查看:273
本文介绍了如何将Excel VBA宏转换为EXE文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用excel宏准备了很多基于Excel的工具.在这些Excel Sheets中,用户通常按照该工具的指导浏览Excel文件或输入数据,然后运行我的宏以生成所需的输出.一切正常.

I have prepared lots of Excel based Tools using excel macros. In these Excel Sheets user normally browses Excel files or inputs data as guided by the tool and then runs my macros to generate a desired output. Everything is working fine.

但是,我可以将我的代码转换为exe文件并将其分发给可以在其中运行它的用户吗,而不是将这些工具分发为Excel工作表?

However, instead of distributing these tools as Excel sheets, can I convert my codes to a exe file and distribute it to users who can run it there?

我在Excel上进行了大量搜索以查找与exe相关的线程,但没有得到满意的答案,因此想到了启动新线程的方法.

I searched a lot on Excel to exe related threads but didn't get a satisfying answer hence thought of starting a new thread.

推荐答案

这个答案可能也不能令人满意,但事实是Excel并不是生成独立应用程序(exe)的编程工具.

This answer might not be satisfying too but the fact is that Excel is no programming tool to produce stand alone applications (exe).

因此,您需要使用像VB.NET或C#这样的 real 编程语言(和工具)重新编写项目.VBA(用于应用程序的Visual Basic)旨在按其名称所述在应用程序中运行(例如Excel或其他Office应用程序),但不能独立运行.

Therefore you need to re-write your project using a real programming language (and tool) like VB.NET or C#. VBA (Visual Basic for Applications) is meant to run in applications as its name says (like Excel or other Office applications) but not stand alone.

如果计划单独使用应用程序,则无法仅通过转换代码(通过按按钮或其他方式)来转换代码,您将需要用另一种编程语言完全(手动)完全重写整个项目/工具.(exe)没有Excel.

There is no way of just converting the code (by pressing a button or something) you will need to re-write the whole project/tool completely (by hand) in another programming language if you plan to use your application stand alone (exe) without Excel.

请注意,即使VBA和VB.NET使用类似的语法,也不能仅复制代码.这是2种完全不同的语言,需要重新编写代码.即使结果看起来相似,也不一样.

Please note that even if VBA and VB.NET use similar syntax you cannot just copy the code. These are 2 completely different languages and the code needs to be re-written. Even if the result would look similar it is not the same.

这篇关于如何将Excel VBA宏转换为EXE文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆