Jump to content

Shauni

Member
  • Posts

    3
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Finland

Everything posted by Shauni

  1. So... problems again I'll describe the macro again... Every x hours a scheduled task starts the xls-file containing the macro. Goal is to capture data from our factory in an xls-file. Data is collected from an SQL database into the file. The xls-file contains data from one month. So at the moment we have 12 files: file-jan.xls -> file-dec.xls. I first check to see if the file exists. If it doesn't exist, the macro creates it using a template (there's also a check to see if the template exists but that's really not that important). Second check is to see if the file is already open or not. If not => macro executes and captures the data into the file. If the file is open I use the following code to create a "net send" message saying the file was already open and they should capture the data manually. The net send containt the pc-name, NOT the username. strcmd = "net send " & "pc" & " " & "File was open. No data collected." dShellResult = Shell("COMMAND.COM /C " & strcmd) Problem is the message doesn't appear on the screen and the scheduled task can't end properly. It's being terminated after 2 minutes, but the user never receives any warnings about the data not being captured. Also tried to use a simple messagebox, but that doesn't work either. I scheduled this task with an admin account on the pc that will be running the macro. Afterwards I use a normal user account to simulate a user working on that pc with the scheduled task running in the background. It works as long as the file is not open at the moment the scheduler tries to executes the macro. Does anyone have any suggestions about how to solve this?
  2. No Excel was not launched. I had to end the task manually for it to stop. Task started, did nothing but kept running. Yes, have tried different credetials but no luck... Well it seems it DOES matter!! The account I used to test the scheduled task has local admin rights. I did the test again with an account that doesn't have local admin rights and this works just fine Don't really have an explanation for this, but since the users of the program don't have local admin rights anyway I think I'm gonna stick with our current program. Thanks for your help!
  3. Hi, I've set up a scheduled task on my pc using an admin account. This works fine as long as there isn't another (normal user) account logged on to the pc. If I do log on with a normal user account the scheduled task exits with an "exit code of (1)". Scheduled task consists of a .cmd file that opens an Excel-file, runs a macro and closes the file again. Has to run every 2 hours on a pc that's used by 6 different useraccounts. Is there a way to get this to work or do we need to find another solution? Regards, Debbie
×
×
  • Create New...