Fixing dependencies in write excel script