none
automated xlsm file open,save and close RRS feed

  • Question

  • We have  a xlsm file and which has a macro. When we open the workbook it refresh and fills the data from sql server database.

    I have a vb scrip to open, save and close the file but its not working. It is able to open but when i debug in debuger it says file already present in location and if i want to overwrite it. due to this i am not able to schedule the vbs file. 

    Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open("test.xlsm") objExcel.Application.Run "Macro.TestMacro()"

    objExcel.ActiveWorkbook.save objExcel.ActiveWorkbook.Close objExcel.Application.Quit WScript.Echo "Finished." WScript.Quit

    Wednesday, November 20, 2013 10:53 PM