Hi!
I have a working VBScript file and VBA macro in Excel worksheet that does this:
1) refresh all data connections
2) write a timestamp in a specific cell
3) save & close the Excel worksheet
VBS file:
VBA inside the Blank.xlsm worksheet:
Is it possible, to keep the Excel macro-free .xslx file and run both of those functions from an 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.
Thanks!
I have a working VBScript file and VBA macro in Excel worksheet that does this:
1) refresh all data connections
2) write a timestamp in a specific cell
3) save & close the Excel worksheet
VBS file:
Code:
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:
Code:
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 an 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.
Thanks!
Last edited: