ronald cole
Actually, I need help coding the "running a macro" part. I have a spreadsheet with a macro called "snafu" on sheet2 that contains a private subroutine called "runme" tied to a button. I just need to script up something that opens the spreadsheet and runs that subroutine and closes the spreadsheet. Sounds simple, huh Six hours of googling and reading the Microsoft Excel Visual Basic Reference could not clue me! I don't think I'm stupid... but I've been wrong before. Here's what I tried:
Set objExcel = WScript.CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("fubar.xls")
' I don't know what to do here. I tried:
' objWorkbook.Sheets(2).Activate
' objExcel.Run("runme")
' but I got an error about not being able to find "runme".
' please clue me in! thanks!!
objWorkbook.Close
objExcel.Quit