Results 1 to 3 of 3
  1. #1
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    410

    Windows Script Host Error You Made An Illegal Function

    I have looked and tried so many things and I cannot figure this out at all.

    I have a module that is ran from a macro via a .vbs file which Windows Task Scheduler launches to run.

    It works great from my work station. I moved it to the server, it's intermittent.
    it worked once here and there but will not run on the scheduled time.

    Had to change the option to run whether a user is logged on or not. found info on that and made changes per findings, still same issue.



    If I run it the Macro directly from Access it. When I try to run the AutoRun.vbs I get the same error message.

    I don't know what or how it ran under the When User is Logged On, but that won't work after the error comes up trying it with the new task to run whether or not user is logged on. We don't want to rely on someone being logged onto work.

    Anyone else using Task Scheduler to run a VB Macro from Access and come across this issue? Have you found a solution that consistently work?

  2. #2
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 8 Access 2013
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Yes, I do it successult with any user logged on. I use schedule a .cmd file not a VBS.

    Since I don't have a clue what your AutoRun.vbs does , I an unable to help you debug it.

  3. #3
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    410
    This is my AutoRun.vbs
    Code:
    dim accessApp
    set accessApp = createObject("Access.Application")
     
    accessApp.OpenCurrentDataBase("\\File02\usfs\Crystal and Excel Reports - Phoenix\CrystalReports\Memberships\MembershipsReporting.accdb")
    
    accessApp.Run "ExportRptsMacro"
    accessApp.Quit
    set accessApp = nothing
    I did have this bat file AutoRun.bat but it didn't work and why the above is used. And it works EXCEPT on the Server with the intermittent issues.
    Code:
    C:\Windows\System32\cscript.exe "\\File02\usfs\Crystal and Excel Reports - Phoenix\CrystalReports\Memberships\Scripts\AutoRun.vbs"
    Also this AutoProcess.bat using the old /x macroname
    Code:
    C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE 
    \\File02\usfs\Crystal and Excel Reports - Phoenix\CrystalReports\Memberships\Memberships.accdb /x ExportRpts

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Web Browser Google Maps Error, Script Error
    By trini46petes in forum Access
    Replies: 2
    Last Post: 03-03-2015, 06:36 AM
  2. Replies: 26
    Last Post: 06-30-2014, 02:38 PM
  3. Replies: 3
    Last Post: 04-02-2014, 10:31 AM
  4. Run SQL script under VBA Function
    By shabar in forum Programming
    Replies: 12
    Last Post: 03-19-2013, 11:00 PM
  5. Replies: 12
    Last Post: 02-09-2012, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums