How to create an *.exe file with VBA

luzelenamartelo

New Member
Joined
May 13, 2009
Messages
12
Hello fellows of Mr. Excel.

I would like to know if it is possible to create an executable file with Visual Basic 6.0 for an excel appplication. I have developed aa application with the VBA in excel, but i want to create a file that i could install in any computer and if it´s possible, using Visual Basic 6.0 because i would like to open the file directly and not by opening an excel file.

Thanks a lot for any assistance.

Luz E. Martelo
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
In VB6, select Add-Ins, Add in manager, VB6 Resource editor, Loaded/Unloaded, OK, select VB resource editor on tool bar (green), click Add Custom resource (on tool bar of the Resource editor) and add your .xls file. Note the "CUSTOM" number added. Use the following code to instal the .xls file. (not my code. My apolgies for not including the unknown author). HTH. Dave

Code:
LoadDataIntoFile 120, "C:\Myfilename.xls"
' ***120 is Custom Resource number
' "C:\Myfilename.xls" is file destination

Public Sub LoadDataIntoFile(DataName As Integer, filename As String)
    Dim myArray() As Byte
    Dim myFile As Long
    If Dir(filename) = "" Then
        myArray = LoadResData(DataName, "CUSTOM")
        myFile = FreeFile
        Open filename For Binary Access Write As #myFile
        '
        Put #myFile, , myArray
        
        Close #myFile
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,628
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top