C
Cloudfall
Hi. I have a subprocedure which works and which I run each week which
simply calls other subprocedures as follows:
Sub ByWeekAllReports()
k = MsgBox("UPDATE dB. Use US date format mm/dd/yy. If no file
exists, {TAB}{TAB}{enter} will modify these macros.", vbOKCancel)
If k = vbCancel Then Exit Sub
Application.Run ("AutoV05.xls!ByWeekSchoolsV01")
Application.Run ("AutoV05.xls!ByWeekSuppliersV01")
Application.Run ("AutoV05.xls!ByWeekSchoolsAllV01")
Application.Run ("AutoV05.xls!ByWeekNewUsersV01")
Application.Run ("AutoV05.xls!ByYearFinancialV01")
End Sub
So, I'm tidying up my latest programming effort and I want to do
something similar with it. I have a program called "subABNTidy3()"
which lives in workbook "Automation V005.xls". Now, "subABNTidy3()"
works. So, to begin with, all I code is this:
Sub FaxSuppliersAutomation()
Application.Run ("Automation V005.xls!subABNTidy3")
End Sub
Sub subABNTidy3()
:
End Sub
Please note that the new subprocedure is physically coded directly
above the subprocedure it is calling. This new subprocedure does NOT
work, but crashes with this message:
"Run-time error '1004' The macro 'Automation V005.xls!subABNTidy3'
cannot be found."
I've had another guy here at work who, I've discovered, programs in
Excel VBA look at this with me as well. Neither of us can work out why
the old program which uses "Application.Run" works and the new one
doesn't. This isn't a show-stopper or anything. I'll just use the
following which, incidently, works:
Sub FaxSuppliersAutomation()
subABNTidy3
:
End Sub
Sub subABNTidy3()
:
End Sub
Why can this find the subroutine but "Application.Run ("Automation
V005.xls!subABNTidy3")" can't? Thanking you now for any responses.
simply calls other subprocedures as follows:
Sub ByWeekAllReports()
k = MsgBox("UPDATE dB. Use US date format mm/dd/yy. If no file
exists, {TAB}{TAB}{enter} will modify these macros.", vbOKCancel)
If k = vbCancel Then Exit Sub
Application.Run ("AutoV05.xls!ByWeekSchoolsV01")
Application.Run ("AutoV05.xls!ByWeekSuppliersV01")
Application.Run ("AutoV05.xls!ByWeekSchoolsAllV01")
Application.Run ("AutoV05.xls!ByWeekNewUsersV01")
Application.Run ("AutoV05.xls!ByYearFinancialV01")
End Sub
So, I'm tidying up my latest programming effort and I want to do
something similar with it. I have a program called "subABNTidy3()"
which lives in workbook "Automation V005.xls". Now, "subABNTidy3()"
works. So, to begin with, all I code is this:
Sub FaxSuppliersAutomation()
Application.Run ("Automation V005.xls!subABNTidy3")
End Sub
Sub subABNTidy3()
:
End Sub
Please note that the new subprocedure is physically coded directly
above the subprocedure it is calling. This new subprocedure does NOT
work, but crashes with this message:
"Run-time error '1004' The macro 'Automation V005.xls!subABNTidy3'
cannot be found."
I've had another guy here at work who, I've discovered, programs in
Excel VBA look at this with me as well. Neither of us can work out why
the old program which uses "Application.Run" works and the new one
doesn't. This isn't a show-stopper or anything. I'll just use the
following which, incidently, works:
Sub FaxSuppliersAutomation()
subABNTidy3
:
End Sub
Sub subABNTidy3()
:
End Sub
Why can this find the subroutine but "Application.Run ("Automation
V005.xls!subABNTidy3")" can't? Thanking you now for any responses.