View Single Post
 
Old 10-29-2015, 04:02 AM
PRA007's Avatar
PRA007 PRA007 is offline Windows 7 32bit Office 2010 32bit
Competent Performer
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default

I found solution to run my script from CMD

I made following vbscript to run macro saved in macro enabled doc.

Code:
Option Explicit

On Error Resume Next

ExcelMacroExample

Sub ExcelMacroExample() 

  Dim xlApp 
  Dim xlBook 

  Set xlApp = CreateObject("Excel.Application") 
  Set xlBook = xlApp.Workbooks.Open("C:\Users\rahulkumar.patel\Desktop\Fees.xlsm", 0, True) 
  xlApp.Run "OF"
  xlApp.Quit 

  Set xlBook = Nothing 
  Set xlApp = Nothing 

End Sub
Reply With Quote