Problem is that your Sub Compute
is stored in the worksheet code of a Sheet (at least your line of code suggest that). In that case, you need to call it without the sheet name:
Application.run "'" & Workbook_Name & "'!Compute"
However, it is good practice to put code other than event routines into a module. In that case, you can call the routine with or without the module name. Assuming module name Module1
, you can use both:
Application.run "'" & Workbook_Name & "'!Compute"
Application.run "'" & Workbook_Name & "'!Module1.Compute"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…