I have a working VBScript file and VBA macro inside Excel worksheet that does this:
- Refreshes all data connections
- Writes a timestamp in a specific cell
- Save and closs the Excel worksheet
VBS file:
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Run "'G:\Blank.xlsm'!Module9.Date"
objExcel.DisplayAlerts = False
objExcel.Application.Quit
Set objExcel = Nothing
VBA inside the Blank.xlsm worksheet:
Sub Date()
ActiveWorkbook.RefreshAll
With Range("M12")
.Value = Now()
.NumberFormat = "dd/mm/yy hh:mm"
ActiveWorkbook.Save
End With
End Sub
Is it possible to keep the Excel macro-free .xslx file and run both of those functions from a VBScript file, which would not call the macro inside the Excel workbook to do the things I need, but rather complete those tasks by itself? I'm very new to VBScript (and frankly, VBA, too), so I'm sorry if this comes as too basic of a question.
Date
! – 41686d6564