Excel 2016 / file is on an external drive (NAS) / using Option Explicit
Hi all,
Yesterday I wrote a (imo) simple vba script and it was working. Another VBA script with the same DIM and Set to my surprise didn't work.
Today none of them are working. The error is: Compile error: Expected variable or procedure, not module.
First the one who worked perfectly yesterday but not anymore
The one who didn't work yesterday and today (same DIM and Set):
Thanks in advance for your help.
Cheers Jan
Hi all,
Yesterday I wrote a (imo) simple vba script and it was working. Another VBA script with the same DIM and Set to my surprise didn't work.
Today none of them are working. The error is: Compile error: Expected variable or procedure, not module.
First the one who worked perfectly yesterday but not anymore
HTML:
Sub WorkbookTasks()
Dim WK As Workbook
Dim WS As Worksheet
'"Y:\001 Office\01 Excel\Zelfstudie\VBA\# Eigen Oefeningen\Workbooks ExcelMacroMastery.xlsm")
Set WK = Workbooks("Workbooks ExcelMacroMastery.xlsm")
For Each WK In Application.Workbooks
For Each WS In WK.Worksheets
Debug.Print WK.Name, WS.Name 'Just the name of the file
Debug.Print WK.FullName, WS.Name 'Including the directory
Next WS
Next WK
End Sub
The one who didn't work yesterday and today (same DIM and Set):
HTML:
Sub WorkbookSave()
Dim WK As Workbook
Set WK = Workbooks("Workbooks ExcelMacroMastery.xlsm")
WK.Save
End Sub
Thanks in advance for your help.
Cheers Jan