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
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.