When QEMC/Publisher executes a macro it does so as the user that is running the Publisher service.
Make sure that the user has access to the folder where you are accessing files and also that the Z: drive is a valid path for that user. Most likely if you have never logged on with that user the mapping won't exists so you might want to go with the full folder name instead.
When you are reloading the document locally you are executing the macro as your user.
Also make sure that the macro has full system access and that the server is allowed to execute macros.