Error in Automation Script "Export_1 - The process cannot access the file 'K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm' because it is being used by another process."

I hope someone has an easy fix. First my stats:

Toad Data Professional 3.3 32bit

Win7 32bit

Excel 2010

I have been doing some development of new automation scripts and now they are starting to fail with the error message in the subject . I will attach my log file so you can see. This is getting very annoying. I have gone as far as shutting down my PC and opeing just TDA and running the script and I still get the same error. I can not figure out what is holding the excel file and not releasing it. Please help!!!

Error Log:

– 4/9/2014 3:29:41 PM: DistributionSpendReport1.log: Setting up environment
– 4/9/2014 3:29:41 PM: DistributionSpendReport1.log: Script run by Toad Data Point 3.3.0.1526
– 4/9/2014 3:29:41 PM: DistributionSpendReport1.log: Build started
– 4/9/2014 3:29:41 PM: DistributionSpendReport1.log: Compiling Script
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Activity ‘ExceptionEmail’ validation warning: Text of message body is not specified
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Build Completed
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Begin execution script activities
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Variable “Month End Date” set to ‘2014_03’
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Destination file name: K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Destination folder name: K:\MMIS\RptRequests\GRakes
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: File will be copied and not moved
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Copied file StaticDistributorSpend.xlsm to K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Copy File finished, click DistributorSpend.xlsm to view file.
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Running export template K:\MMIS\RptRequests\GRakes\Automation\DistributionSpendReport1.txp
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Excuting export using connection LAWSON_REPORT.PHSOR.ORG (WILSEYEL), WILSEYEL
– 4/9/2014 3:29:49 PM: DistributionSpendReport1.log: Beginning export: <Quest.Toad.ImportExport.ExportEngine></Quest.Toad.ImportExport.ExportEngine>
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) Adding Export Notification Subscriber {0}
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) Export Started [4/9/2014 3:29:49 PM]
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) ** START **
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) Export using connection: LAWSON_REPORT.PHSOR.ORG (WILSEYEL), WILSEYEL
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) Export Wizard: Building object list
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) Build List done.
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) Exporting Data (1 of 1)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) BEGIN Query :
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (11) Object SQL Query started.
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:29:49 PM Thread (18) InternalReadBackground - start
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:37 PM Thread (18) InternalReadBackground - after ExecuteReader - command SELECT V1.VENDOR_GROUP_NAME AS VENDOR_NAME,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: TO_CHAR (REC.REC_DATE, ‘MM-YYYY’) AS REC_MONTH,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: SUM (REC.EXTENDED_AMT) AS EXTEND_AMT
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: FROM REPORT.MM_RECEIPTS REC
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: INNER JOIN
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ( SELECT APV.VENDOR,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: APV.VENDOR_VNAME,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: APV.VENDOR_SNAME,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: APV.VENDOR_STATUS,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: APV.VEN_CLASS,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: CASE
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: WHEN TRIM (APV.VENDOR) = ‘137370’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: THEN
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ‘137370 - DISTRIBUTION OPERATIONS CENTER’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: WHEN TRIM (APV.VENDOR) = ‘10322’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: THEN
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ‘10322 - OWENS_AND_MINOR_INC’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: WHEN TRIM (APV.VENDOR) = ‘11139’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: THEN
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ‘11139 - MEDLINE INDUSTRIES INC’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: WHEN TRIM (APV.VENDOR) = ‘56665’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: THEN
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ‘56665 - SUTURE EXPRESS INC’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: WHEN TRIM (APV.VENDOR) IN (‘25058’, ‘119969’)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: THEN
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ‘25058 & 119969 - CARDINAL HEALTH’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ELSE
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ‘ZZZ ALL OTHER VENDORS’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: END
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: AS VENDOR_GROUP_NAME
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: FROM REPORT.MM_APVENMAST_PHS APV
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: WHERE TRIM(APV.VEN_CLASS) IN (‘SUP’,‘NAC’))V1
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ON TRIM(REC.VENDOR) = TRIM(V1.VENDOR)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: --WHERE REC.REC_DATE BETWEEN ‘01-JAN-13’ AND ‘31-DEC-13’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: WHERE REC.REC_DATE BETWEEN TRUNC(SYSDATE, ‘YEAR’) AND TRUNC (SYSDATE, ‘MM’) - 1
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: AND REC.PO_TYPE NOT LIKE ‘Capital’
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: GROUP BY V1.VENDOR_GROUP_NAME, TO_CHAR (REC.REC_DATE, ‘MM-YYYY’)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: ORDER BY V1.VENDOR_GROUP_NAME,
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: TO_CHAR (REC.REC_DATE, ‘MM-YYYY’)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (1) User cancelled
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (18) InternalReadBackground - exception Command cancelled by user
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (18) InternalReadBackground - stack at Quest.Toad.Db.ToadDataAdapter.CheckCancel()
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at Quest.Toad.Db.ToadDataAdapter.InternalReadBackground()
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (12) DoneReadTreadWriter
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (12) DoneReadThreadWriter finally - adapter.RowsRead 0
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (11) END Query :
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (11) Object SQL Query finished with error: The process cannot access the file ‘K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm’ because it is being used by another process.
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (11) at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(String fileName, ExcelOpenType openType, ExcelVersion version, ExcelParseOptions options)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(String fileName, ExcelOpenType openType)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at Quest.Toad.ImportExport.Writers.WriterExcel.InitializeFileLocation()
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at Quest.Toad.ImportExport.Writers.WriterExcel.WriteHeader(Object tableObject)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: at Quest.Toad.ImportExport.ExportObjectData.adapter_SchemaReady(Object sender, FastTableArgs args)
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (11) Export Finished [4/9/2014 3:30:49 PM]
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: Thread (11) Build Time 00:00:00.3745896
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: Thread (11) Complete Time 00:01:00.3170088
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: 3:30:49 PM Thread (11) ** END **
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: Successfully exported 0 rows.
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: Export Finished, click DistributorSpend.xlsm to view file.
– 4/9/2014 3:30:49 PM: DistributionSpendReport1.log: Export_1 - The process cannot access the file ‘K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm’ because it is being used by another process.

– 4/9/2014 3:30:50 PM: DistributionSpendReport1.log: Start error email
– 4/9/2014 3:30:50 PM: DistributionSpendReport1.log: Email To: Elizabeth.Wilsey@providence.org, From: Elizabeth.Wilsey@providence.org, cc:
– 4/9/2014 3:30:50 PM: DistributionSpendReport1.log: Email Subject: Automation Script Error
– 4/9/2014 3:30:50 PM: DistributionSpendReport1.log: Generating exception Email
– 4/9/2014 3:30:50 PM: DistributionSpendReport1.log: Email message:

Automation script “DistributionSpendReport1” had errors while executing. The exception messages are listed below and the log file is attached.

Exception Messages:
Export_1 - The process cannot access the file ‘K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm’ because it is being used by another process.

– 4/9/2014 3:30:50 PM: DistributionSpendReport1.log: Setting up SMTP email

I saw there’s a step to copy the DistributorSpend.xlsm file. Could you try manually copy the file there and disable the copy step to see if it makes difference?

This might be an issue we already fixed, do you want to try our 3.5 beta to confirm it? The beta can be installed side by side with your current 3.3.

I still get the same error please see attached.

What I do not understand is this workflow works with other scripts. The only thing different is this file has a pivot table but I have had success running
this type of workflow before that had a pivot table in the work book.

I would be glad to try the new version but my team would need to be in agreement to move to this version.

Thank You,

Liz Wilsey

MMIS Analyst, SCM Information Systems

One Supply Chain Management

Office: 503-215-6968

email:
mailto:elizabeth.wilsey@providence.org

From: Kiki [mailto:bounce-Kiki@toadworld.com]

Sent: Thursday, April 10, 2014 10:54 AM

To: toaddatapoint@toadworld.com

Subject: RE: [Toad Data Point - Discussion Forum] Error in Automation Script “Export_1 - The process cannot access the file ‘K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm’ because it is being used by another process.”

RE: Error in Automation Script "Export_1 - The process cannot access the file ‘K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm’
because it is being used by another process."

Reply by Kiki

This might be an issue we already fixed, do you want to try our 3.5 beta to confirm it? The beta can be installed side by side with your current 3.3.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Point - General
notifications altogether.

Toad Data Point - Discussion Forum

Flag
this post as spam/abuse.


This message is intended for the sole use of the addressee, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the addressee you are hereby notified that you may not use, copy, disclose,
or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete this message.

I would agree this should be checked against the latest 3.5 beta just to see if it works OK.

Igor.

I just started experiencing the same issue in TDP 3.7. I have not used the export wizards before, and I recently started to use them with Excel macro files. The issue happens when the export template tries to access the macros. This causes Excel to stay open and lock the file. Here is the error that the export wizard throws:

System.Runtime.InteropServices.COMException
Exception from HRESULT: 0x800AC472

I think this is what is causing the issue. I tried recreating the Excel file, which allowed me to go through the export wizard, but then when I tried to run the automation script again, I receive the error about the file being locked. I then went back into the automation script and got the error above again.

I upgraded 1 of the scripts I was running in 3.7 to 4.2 and I don’t seem to be having the issue anymore.

I had lots of problems with automation and exporting to excel with macros. The new version of Toad fixed the issue.

From: andy.corson [mailto:bounce-andycorson@toadworld.com]

Sent: Friday, May 12, 2017 1:49 PM

To: toaddatapoint@toadworld.com

Subject: RE: [Toad Data Point - Discussion Forum] Error in Automation Script “Export_1 - The process cannot access the file ‘K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm’ because it is being used by another process.”

RE: Error in Automation Script "Export_1 - The process cannot access the file ‘K:\MMIS\RptRequests\GRakes\DistributorSpend.xlsm’ because it is being used by another process."

Reply by andy.corson

I just started experiencing the same issue in TDP 3.7. I have not used the export wizards before, and I recently started to use them with Excel macro files. The issue happens when the export template tries to access the macros. This causes Excel to stay open and lock the file. Here is the error that the export wizard throws:

System.Runtime.InteropServices.COMException

Exception from HRESULT: 0x800AC472

I think this is what is causing the issue. I tried recreating the Excel file, which allowed me to go through the export wizard, but then when I tried to run the automation script again, I receive the error about the file being locked. I then went back into the automation script and got the error above again.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Point Forum
notifications altogether.

Toad Data Point - Discussion Forum

Flag
this post as spam/abuse.