Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Batch Macro - Writing to Multiple Sheets within Same Excel - Unable to Create Backup Error

sophabraham95
7 - Meteor

Im using a batch macro to write to multiple tabs within a single excel file. And I get an error randomly at times.

Can you help me understand why. I have attached a sample macro for this use case and error message.

 

error message 

Error: WriteToTabMacro (96): Record #1: Tool #14: Unable to create backup of Output\TTTT_ALTERYX.xlsx to Output\TTTT_ALTERYX.xlsx.bak: The process cannot access the file because it is being used by another process. (32)

 

Note:

AMP Engine is off

Batch Macro Takes filename as Control paramater

Creates a new sheet each time, not overwrites

4 REPLIES 4
binuacs
20 - Arcturus

@sophabraham95 try the overwrite sheet option

image.png

jdminton
12 - Quasar

That error message is the same as what you'd get when trying to use two output tools to the same Excel file without a block until done or control container. I'm curious why you are doing this as a macro. It should work fine having the output tool directly in the workflow. @binuacs is correct that you'd want to change to overwrite if these files are going to be run more than once, but I'd put the output data tool directly into the workflow. There's no reason to use a macro here.

Snag_1dbb25bc.png

Snag_1dbb5140.pngSnag_1dbbda37.png

apathetichell
19 - Altair

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Output-Error-Unable-to-create-...

 

also points to potential temporary virus scan locking the bak file.

jdminton
12 - Quasar

@apathetichell you're correct. My question of why use a macro still stands though 😀. I could see the same issue with the .bak if the output is being completed quickly enough, but I don't recall every seeing it specific to the .bak myself.

Labels