- Scores: 0
- Joined: 1/4/2017
Help to run macro inside a vbscript
Wednesday, January 04, 2017 10:24 PM
I also have an macro and I have saved it as an module (..\Script\FormatToNumber.bas) the macro formating column H in the excel file to number and 0 decimals.
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.DisplayAlerts = False
ExcelObj.Visible = true ' or false
"Here should the macro from the path ..\Script\FormatToNumber.bas run"
ExcelObj.Workbooks(1).SaveAs "..\myfile_new.txt", -4158
What I want is that the VBScript shall run the macro "FormatToNumber.bas
" before it saving the file as an text file.
I have tried several codes from different forums but always getting an error when it shall start the macro.
I hope someone can help me with this, thanks
I have an VBscript that open a specific excel file and save it to an text (tab delimited) file and close the excel file.