Jenkins Error "Microsoft Excel cannot access the file" - jenkins

I am using jenkins to run a .bat file that is in location
C:\Users\foo\Desktop\xxx.bat
which internally
copies from another machine an excel
calls a vbs script found in D:
D:\foo\Newtask.vbs
that opens a file:
C:\Users\foo\Desktop\xxx\xxx\xxx\New.xlsm
The error I am getting is
For the first excel: The system cannot find the path specified
For the second New.xlsm:
D:\foo\Newtask.vbs(14, 1) Microsoft Excel: Microsoft Excel cannot access the file 'C:\Users\foo\Desktop\xxx\xxx\xxx\New.xlsm'. 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
I find it odd that jenkins can access and run .bat in foo user's directory while it cannot find C:\Users\foo\Desktop\xxx\xxx\xxx\New.xlsm --> I checked it exists.
When running the .bat manually i have no problem.
Any ideas?

I had the same issue. Solution from this page worked https://techcommunity.microsoft.com/t5/sql-server-support-blog/error-8216-microsoft-office-excel-cannot-access-the-file-8217/ba-p/317477
...x64: Create the following directory:
C:\Windows\SysWOW64\config\systemprofile\Desktop
x86: Create the following directory:
C:\Windows\System32\config\systemprofile\Desktop...

Related

Juypterlab | ipyfilechooser ignores start_path option with UNC paths and also local paths

I started working with Jupyterlab to analyse bunches of CSV files.
It is installed and run within an virtual environment on a windows PC (Windows 10, Python 3.9, JupyterLab 3.5.2).
As the filenames often change and our paths are quite deep I thought a file dialogue would be a good starting point to get data in.
I searched a while and found that ipyfilechooser could be my friend.
So I created a Jupyter Notebook and started with this code block:
import ipywidgets
from ipyfilechooser import FileChooser
chooser = FileChooser(
accept='.csv', # only show CSV files
multiple=False, # allow only one file
# optional starting path
start_path=r'\\sglx-srv1\geschaeft\MESSPLATZ'
)
display(chooser)
After executing this block a chooser widget appeared and I could select a folder or file, also from a UNC path (network drive).
But the setting of the start_path was always ignored and the dialogue always started from the folder the notebook itself is stored in.
I tried any variant I could find to quote the path, but with no luck.
It was not possible to let the file chooser start from any specified path neither local nor UNC.
What is wrong here? Is it a bug in my code or elsewhere?

Essbase Error 1241109 Unable to Open file

I am automating the process to run a report script. The batch script is located on Windows and the Essbase server is on UNIX.
Getting an error while executing the below statement
export database App.DB using server_file 'Report1.rep' to data_file '/apps/AppName/FileName.txt';
TIA
is the path correct?
Essbase does not create directories, so maybe /apps/Appname does not exist.
I would also suggest to put the Files under Appname/Database but thats a personal thing.

Not able to run .vbs file from jenkins which is having excel script

I’m new to Jenkins and now I'm doing basic level of execution. And I need your help resolve my issue. Issue Description: I’m trying to run the .VBS file by using jenkins and getting below error:
C:\Users\Amar\Desktop\Test_Sample.vbs(3, 2) Microsoft Excel: Microsoft Excel cannot access the file ‘C:\Users\Amar\Desktop\New.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.
I have not opened any excel file and path also correct.
please find below batch command : CScript “C:\Users\Amar\Desktop\Test_Sample.vbs”
And in Test_Sample.vbs file having:
Dim ExcelObj, WbookObj, mysheet
Set ExcelObj= CreateObject("excel.application")
Set WbookObj= ExcelObj.workbooks.open("C:\Users\Amar\Desktop\New.xlsx")
Set mysheet= ExcelObj.ActiveWorkbook.Worksheets("Sheet1")
ExcelObj.Visible = False
ExcelRowCount = mysheet.UsedRange.Rows.Count
For Iterator = 2 To ExcelRowCount
ModuleName = Ucase(Trim(mysheet.Cells(Iterator,1)))
ExecutionFlag = Ucase(Trim(mysheet.Cells(Iterator,2)))
if (moduleName="Raj") Then
Set qtApp = CreateObject("QuickTest.Application")
If qtApp.launched True then
qtApp.Launch
End If
qtApp.Visible = True
qtApp.Open "F:\Jenkins_Jobs\OnCall_Sanity_Automation\DriverScript\Sample", False
Set QTPTest=qtApp.Test
QTPTest.Run 'Run the Test QTPTest.Close
qtApp.quit
Set qtApp = Nothing
else
MsgBox "Name not exists"
End If
Next
Please help me to resolve the issue.
Thanks, Amar
Update
Console Output:
Building in workspace C:\Program Files
(x86)\Jenkins\workspace\Excel_Test [Excel]
$ cmd /c call C:\WINDOWS\TEMP\jenkin02.bat (C:\Program Files
(x86)\Jenkins\workspace\Excel_Test>CScript )
C:\Users\Admin\Desktop\Test_Sample.vbs"
C:\Users\Admin\Desktop\Test_Sample.vbs(3, 2) Microsoft Excel:
Microsoft Excel cannot access the file
C:\Users\Admin\Desktop\New.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.
If you are working on 64-bit Windows Operating System.
Then go to
C:\Windows\SysWOW64\config\systemProfile
Above Folder and create an empty Folder, and name it "Desktop" inside "systemProfile".
For doing this, you need system admin access
After creating the folder as mentioned, then run your build in Jenkins.
Run the jenkins job in command prompt on a slave,it will work!
Set Full control permissions for below path "Desktop" directory
"C:\Windows\SysWOW64\config\systemprofile\Desktop " (for 64 bit Windows) or "C:\Windows\System32\config\systemprofile\Desktop " (for 32 bit Windows)
If Desktop directory in present please create and give Full control permissions

Jenkins / Upload file to Jenkins machine

I try to upload file to my jenkins machine.
I try to use the File Parameter option, and put in the File location line:/opt/myFolder.
I wish that if I'll choose a.txt file from my local machine, then it will be uploaded to /opt/myFolder/a.txt.
But it gives me an error: FATAL: /opt/myFolder (Is a directory)
How can I fix it?
See my answer here, How to upload a .xlsx file to jenkins job. Basically the name you enter in the File Parameter setting will be the name of the file, so in your case you have set File location to be /opt/myFolder, however it should be the actual file location, so /opt/myFolder/a.txt. This do however mean that the file will have the same name each time.
And as Christopher Orr points out in the comments, the file location should be a relative URL so that it is loaded into the workspace, that way it won't hinder you from running jobs in parallel and on different machines.

SSIS not writing file while executing from different user

I have developed SSIS package to export data to excel file. below are the steps executed by the package
1.Send mail of starting package
2.Copy excel Template to Source folder ( This is Temporary file )
3. Retrieve data (In this step we are retrieve data from 6-7 tables)
4.create folder structure to export i.e First check folder for year and month if not exist dot create
5.Copy the source folder file (Step2) to above create folder.
The problem here is when I deploy and execute package through my account its run perfectly. But same package with same setting if I run through different account its not writing file ie. Its copies source file at the end. but in execution it shows its executed successfully at the start. click for excution Report
Based on your description, please check your account permission for the one you failed to run the package. The account to execute to package should have the full permission to read from database and also make sure that account could visit, read and write to windows directory.

Resources