Welcome !
         

 Help to run macro inside a vbscript

Author Message
pfr

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 1/4/2017
  • Status: offline
Help to run macro inside a vbscript Wednesday, January 04, 2017 10:24 PM (permalink)
0
I have an VBscript that open a specific excel file and save it to an text (tab delimited) file and close the excel file.
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
ExcelObj.Workbooks.Open "..\myfile.xls"
"Here should the macro from the path ..\Script\FormatToNumber.bas run"
 ExcelObj.Workbooks(1).SaveAs "..\myfile_new.txt", -4158
ExcelObj.Quit


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
 
#1
    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2017 ASPPlayground.NET Forum Version 3.9