Hi,
i have a marco in .xlam format and a .csv file both in the same folder, i am trying to do is write a vba script to be able to run the macro on the .csv file.
Here is the code i have tried so far...
Sub Main
Dim objExcel As Object
Dim objWorkBook As Object
Dim objWorkBook2 As Object
Dim objWS As Object
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Open("C:\Documents and Settings\auxservices\Desktop\Test Aux Automation\Macro_BIC_Roster_test.xlam")
Set objWorkBook2 = objExcel.Workbooks.Open("C:\Documents and Settings\auxservices\Desktop\Test Aux Automation\CNP_POWERSCHOOL_ENROLLMENT.csv")
objExcel.Application.Run ("CNP_POWERSCHOOL_ENROLLMENT.csv!BIC_roster_test")
End Sub
I was getting an error 1004 Cannot run the macro CNP_POWERSCHOOL_ENROLLMENT.csv!BIC_roster_test.The macro may not be available in this workbook or all macros may be disabled.
Any help please.... iam very new to this scripting.
Bookmarks