I wonder how would you assign VBA codes written on Excel VBA to a sort of procedure/programme or maybe dos related filepath, which you can directly without opening excel. In
Though the learning curve may be a bit steep, but you could consider using AutoHotKey. This allows you to create your own scripts and if so desired turn them into (rather large) .exe files. AutoHotKey is free!
write a cmd or ps1 that opens an excel and in that excel's startup run your macro... and then when finished close it.
this can be a solution but you are probably doing something which is unnecessary in correct planned environments.
If the VBA in the Excel macro doesn't reference Excel objects, you can just copy the code into a text file and change the extension to .VBS. However, VB script doesn't like it when you use types, just delete the "AS something" from your Dim statement.
I do this often to get the benefit of Intellisense, which I wouldn't have using Notepad.
If my assumption is correct, then you probably want to change your tags to VB Scripting instead of Excel to get appropriate help.
You can do it easily.
Add the following content in a VBS file (e.g. example.vbs). This is only a text file that you can write using Notepad:
'Code should be placed in a .vbs file
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Run "'C:\path\to\my\excel\file\myExcelMacroFile.xlsm'!MyModule.MyFunctionName"
objExcel.DisplayAlerts = False
objExcel.Application.Quit
Set objExcel = Nothing
Then you can double clic on the VBS file to execute it.
Source: http://wellsr.com/vba/2015/excel/run-macro-without-opening-excel-using-vbscript/
If I understand that right, you can simply write VBS code in a text file and rename it to .vbs (make sure file endings are visible in Windows). On doubleclick the file is executed by the Windows Scripting Host. VBS lacks some functionality of VBA but you can do a lot with CreateObject/GetObject.