Home » excel » excel – Converting the VBA script into .exe file

excel – Converting the VBA script into .exe file

Posted by: admin May 14, 2020 Leave a comment

Questions:

Is there any way or a tool to convert VBA script into .exe file.

Ex: I will just click on .exe file. so the macro should run automatically and it should work in the similar way we run manually from excel macros.

your inputs are really helpful.

How to&Answers:

Just create a vbs file.

It is almost the same language (VBS and VBA) so the ‘translation’ should be fairly easy.

You can even do easier like creating a vbs file that opens your workbook and runs the macro inside the workbook.

The file would look like :

Dim XlApp
Dim wb
dim ws
Set XlApp = CreateObject("Excel.Application")
XlApp.Visible = True
Path = "myPath"
Set wb = XlApp.Workbooks.Open(path & "myworkbookname")
set ws = wb.Sheets("mySheetName")

wb.Application.run "module1.macro1"
wb.close