diff --git a/scripts/close_excel.vbs b/scripts/close_excel.vbs new file mode 100644 index 0000000..ac2f60c --- /dev/null +++ b/scripts/close_excel.vbs @@ -0,0 +1,9 @@ +On Error Resume Next +Dim objExcel +Set objExcel = GetObject(, "Excel.Application") +If Not objExcel Is Nothing Then + objExcel.DisplayAlerts = False + objExcel.Quit + Set objExcel = Nothing +End If +WScript.Echo "Excel closed" diff --git a/scripts/convert_to_xlsm.vbs b/scripts/convert_to_xlsm.vbs new file mode 100644 index 0000000..8a8d873 --- /dev/null +++ b/scripts/convert_to_xlsm.vbs @@ -0,0 +1,28 @@ +On Error Resume Next + +Dim objExcel, objWorkbook +Dim sourcePath, destPath + +sourcePath = "C:\Users\alexi\Documents\projects\freelance-dashboard\templates\FreelanceDashboard.xlsx" +destPath = "C:\Users\alexi\Documents\projects\freelance-dashboard\templates\FreelanceDashboard.xlsm" + +Set objExcel = CreateObject("Excel.Application") +objExcel.DisplayAlerts = False +objExcel.Visible = False + +Set objWorkbook = objExcel.Workbooks.Open(sourcePath) + +' 52 = xlOpenXMLWorkbookMacroEnabled (.xlsm) +objWorkbook.SaveAs destPath, 52 + +objWorkbook.Close False +objExcel.Quit + +Set objWorkbook = Nothing +Set objExcel = Nothing + +If Err.Number = 0 Then + WScript.Echo "SUCCESS: File converted to .xlsm" +Else + WScript.Echo "ERROR: " & Err.Description +End If diff --git a/templates/FreelanceDashboard.xlsm b/templates/FreelanceDashboard.xlsm new file mode 100644 index 0000000..1b8afa0 Binary files /dev/null and b/templates/FreelanceDashboard.xlsm differ diff --git a/templates/FreelanceDashboard.xlsx b/templates/FreelanceDashboard.xlsx index 12ef85c..6a0f1e8 100644 Binary files a/templates/FreelanceDashboard.xlsx and b/templates/FreelanceDashboard.xlsx differ