|
-
Mar 27th, 2012, 04:07 PM
#1
Thread Starter
New Member
Run Excel Macro through VBS
Ihave created a VBS script to open an Excel file. I need the script to run 2 macros that I have saved, one formats the worksheet and the other saves the file as a .csv file.
I have the following script, but I am getting a runtime error on line 8:
Dim objExcel
Dim objWorkbook
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
set objWorkbook = objExcel.Workbooks.Open("C:\Users\Desktop\SRI\SRI_Import.xlsx")
objExcel.run "'PERSONAL.XLSB'!SRIStudent"
objExcel.Ontime Now, "PERSONAL.XLSB!SRIStudentSave"
objWorkbook.Close true
objExcel.Quit
Set objWorkbook = Nothing
Set objExcel = Nothing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|