Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
Eg:
This fails because the application looks for a macro named literally "Reopen(Workbook.Path & Workbook.Name)".
Is there a way to pass arguments to a macro using this method?
Code:
Sub Test()
b7 = ThisWorkbook.Path & ThisWorkbook.Name
Application.OnTime Now + TimeValue("00:00:02"), "Reopen(" & b7 & ")"
ThisWorkbook.Close SaveChanges:=True
End Sub
Public Function Reopen(Path, Workbook)
'==================================================
'Update 01: Reopens workbook after creation of new sheet
'Variable Purpose
'i1 Workbook and Path
'==================================================
i1 = Path & Workbook
Workbooks.Open i1
End Function
This fails because the application looks for a macro named literally "Reopen(Workbook.Path & Workbook.Name)".
Is there a way to pass arguments to a macro using this method?