M
meiwr
Dear Excel Experts:
I wrote lots of VBA codes to conduct some special tasks, and I don't
want the end users to view the code. I know that the VBA code can be
converted into a DLL file which can be loaded when needed. But this way
wouldn't have some disadvantages. A major disadvantage is that the end
user has to code it for calling any specific functions or subs defined
in the DLL file. Another is there is no way to set up menu items or
command bars.
I'd like the VBA codes to be compiled/saved in an EXE file like in an
Excel Add-in file, which can be loaded up by Excel workbook when opened
like the following:
Sub Autpen
Workbooks.Open Filename:="c:\xxx\'MyExeFileName'.exe"
Application.Run Macro:="Task1"
End Sub 'Autpen
In the above scenario, task1 is the entry point to set up environment
parameters for my specific tasks, such as setting up menu items,
command bars which link to the procedures defined in the EXE file. The
"MyExcelFileName.exe" will be shown in the VBA project window of Excel
VBE. But when you double-click on it, you got an error message "Project
is unviewable" .
In this way, the end user performs a certain task like running a
standalone EXE application except under Excel application.
My question is
A. How to convert the VBA code contained in an Excel workbook into an
EXE file and to make it work in the way described above?
I do know it works in that way as I downloaded one example of that from
Internet.
Any detailed suggestion/thoughts will be greatly appreciated.
Kind regards,
Ken
I wrote lots of VBA codes to conduct some special tasks, and I don't
want the end users to view the code. I know that the VBA code can be
converted into a DLL file which can be loaded when needed. But this way
wouldn't have some disadvantages. A major disadvantage is that the end
user has to code it for calling any specific functions or subs defined
in the DLL file. Another is there is no way to set up menu items or
command bars.
I'd like the VBA codes to be compiled/saved in an EXE file like in an
Excel Add-in file, which can be loaded up by Excel workbook when opened
like the following:
Sub Autpen
Workbooks.Open Filename:="c:\xxx\'MyExeFileName'.exe"
Application.Run Macro:="Task1"
End Sub 'Autpen
In the above scenario, task1 is the entry point to set up environment
parameters for my specific tasks, such as setting up menu items,
command bars which link to the procedures defined in the EXE file. The
"MyExcelFileName.exe" will be shown in the VBA project window of Excel
VBE. But when you double-click on it, you got an error message "Project
is unviewable" .
In this way, the end user performs a certain task like running a
standalone EXE application except under Excel application.
My question is
A. How to convert the VBA code contained in an Excel workbook into an
EXE file and to make it work in the way described above?
I do know it works in that way as I downloaded one example of that from
Internet.
Any detailed suggestion/thoughts will be greatly appreciated.
Kind regards,
Ken