Convert Microsoft Excel file to text file

Rajashekar Marri 61 Reputation points
2021-08-06T16:52:44.787+00:00

Hi,

I have a requirement from our customers to convert excel files to text files. I was provided with a PowerShell script to convert excel to text to be run every day. When I run the script from PowerShell the script runs as expected converts excel files to text files but when I schedule and run it through task scheduler it is erroring with the below log,

****Microsoft Excel cannot access the file 'E:\Test_reports\PaymentWarehouse\test\ETPAY-en_2021-07-21T092301719Z.xlsx'.
There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.

The workbook you are trying to save has the same name as a currently open workbook.\n****

Please let me know if anyone got an idea,

Thanks

Microsoft 365 and Office | Excel | For business | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Viki Ji_MSFT 4,471 Reputation points
    2021-08-09T05:06:50.117+00:00

    @Rajashekar Marri ,

    Which version of Office are you using?

    Per my research, please create the following folder and add full control permissions for the relevant users.

    • For 64-bit Windows:
      C:\Windows\SysWOW64\config\systemprofile\Desktop
    • For 32-bit Windows:
      C:\Windows\System32\config\systemprofile\Desktop

    For more information, please refer to the method in this similar thread.
    Please note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

    Hope the information is helpful to you.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Rajashekar Marri 61 Reputation points
    2021-08-09T15:36:32.537+00:00

    I tried creating the Desktop folder in the path mentioned, it did not work.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.