POWERSHELL on scheduled task : windows server 2019 and excel 2013 - excel

Had an issue with excel 2013 invoked with scheduled task via powershell.
I added "Desktop" directory on C:\Windows\SysWOW64\config\systemprofile. (for 32 bits too)
Now i can read excel file but i can't save excel file.
Windows server 2019.
Excel 2013.
It was working on 2008 R2.
Thanks for help.

Ok, I've found a trick.
Microsoft said that automation on server side is not supported by devs.
https://support.microsoft.com/en-us/help/257757/considerations-for-server-side-automation-of-office
Solution is here :
https://social.msdn.microsoft.com/Forums/office/en-US/66afe200-0bff-41f5-a2ca-e43007ad8f31/excelapplication-powershell-script-error-running-from-scheduled-task?forum=exceldev
Open comexp.msc.
Navigate to DCOM config and find Microsoft Excel Application. Right clic and properties
Identity tab >> This user and choose a user who has a profile on this computer.
You do not need Desktop folders on systemprofile dirs.

Related

When using Runas and launching Excel 2016 I cannot log into Excel

When I launch Excel 2016 using Runas I am not able to log into Excel. The version we are using is in this path "C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE". It appears as a subscription product Microsoft 365 Apps for enterprise. This is corporate Excel and I do not have an individual license key.
When Excel launches it needs to be signed in or it won't work. I can input my corporate email and when I click [Next] the app freezes. It appears to have a modal dialog box "pop-under" that is not visible. If I kill the app it warns there is a dialog box but I cannot switch to it. I cannot input the password because the dialog box is not visible.
Does anyone know a trick to get this to work? Log into Excel after launching with Runas?
TIA

Excel Addin testing in various environments

I have developed a VSTO add-in for Excel and created a setup file to install.
Its working fine in office 365/win10, but I want to check how it performs in different office versions such as 2016, 2019 or 365.
How can i do that ? Is there a smarter way to do it within Visual studio or do i need to create virtual pc for each environment and test them one by one.
You can create a VM and test your MSI there for each supported platform/OS/Excel version. There is no smarter way for that.

ssis 2015 excel Could not retrieve the table information for the connection manager ‘Excel Connection Manager’

we've got a Windows Server 2012 R2 with SSIS 2015 installed, and also SAP BO BI 4.2. There is also Office 2016, and we first tried (and then uninstalled) Microsoft Office Access Redistributable 2010 32bit (which had some problems with BO), and then we successfully installed Microsoft Office Access Redistributable 2016 32bit.
Before the redistributable, the SSIS couldn't even see the Excel component in the data flow. We are accessing with some users in RD to the machine, and there is a user which is administrator.
So, the administrator made all the install/uninstall. If we open a SSIS solution with the administrator, and we open a DTSX with an Excel connection, it hangs. If we try to make a new SSIS to point to a new Excel, when we try to open the table we get "Could not retrieve the table information for the connection manager ‘Excel Connection Manager’". That also happens to some of my collegues.
What is extremely strange, is that this doesn't happen to my user. I can connect to the RD, open the SSIS solution, and all the metadata is loaded. I can create a new DTSX, point to the same Excel on the server, and I see the sheets to choose. Somehow, I guess, my user is the only one which is loading correctly the dlls for Access 2016 (if I try to set a different driver, it doesn't load).
I'll try when I get back to work to see if the suggestion here to read from SQL and see if I get the same error from the other users is always the same...but still I need to get why my user is working.
https://mariussqlbi.wordpress.com/2013/09/06/extracting-data-from-excel-with-ssis/
Any help would be appreciated...
Daniele

ODBC Excel Driver: Unexpected error from external database driver

Since the Windows update from October 10, the ODBC Excel drivers have stopped working. We get the following error when trying to read a file:
"Unexpected error from external database driver (1)"
We open Excel files in Delphi using an ADO connection with the following connection string:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";
I can get it to work by switching to Microsoft.ACE.OLEDB.12.0, but for that to work, all our customers would have to install the Microsoft Access Database Engine Redistributable on all the computers they use our software on.
Does anybody have another solution or workaround? Thanks in advance.
On a customers machine I have deinstalled KB4041681 (Windows 7) which came with last Microsoft Patch.
On my machine I have deinstalled KB4041676 (Windows 10).
After that Microsoft.Jet.OLEDB.4.0 is now working.
I hope that Microsoft will fix this bug soon.
There is one solution. Replace "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1"
with Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyExcel.xls; Extended Properties=\"Excel 12.0;HDR = YES;
After this change you will have to install 2007 Office System Driver: Data Connectivity Components from link on customer machine.
I had the same problem with 2 applications developed by me since 3 years (c# and java).
Since 10-oct-2017 I couldn't export to excel 2003 but 2007 worked, and couldn't import from excel 2003 but 2007 worked too for import.
In ArcGIS Desktop 10.5.1 By ESRI (a most popular software for Geographic processing) Couldn't open excels 2003 and .mdb files.
Temporally Solution: uninstall KB4041693, KB4041687 in windows 8.1 (maybe for w10).
In microsoft changelog of both path say something about "updates [...] and security updates for microsoft jet".
After uninstall and restart all softwares becomes to be normal again.
this problem was introduced in 10-oct-2017.
In microsoft forums this problemas was reported (kb4041693 should "fix" it but still doesn't work).
Maybe in few weeks they will path (properly) this issue.
For me, it worked following these steps:
ps.: We have a Windows Server 2008R2
1 – Download and install this: https://www.microsoft.com/en-us/download/details.aspx?id=23734
2 – Open the .dtsx file and change your Excel connection. On the properties dialog, Click on the three dots in the ConnectionString property and change it to Microsoft Excel 2007. This will automatically change your connection string to:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source={YOURPATH};Extended Properties=”Excel 12.0 XML;HDR=YES”;
3 – Some of our .dtsx files point to a config file (usually has a .dtsConfig extension). I also changed these guys to point to the right provider (pretty much copied and pasted the connection string I got from visual studio)
After this, I ran the SQL Job again and it worked fine.
If you are working with SSIS package then please change your Excel Sheet version 2003 to 2007 in Excel Source or Excel destination.Generally this issue due to excel version.
I had the same problem. Changed Excel 2007 in Excel destinations. It worked. This is same as changing the provider=Microsoft.ACE.OLEDB.12.0.
HERE is the solution... i found it in another forum and work perfectly for me...
it will works 100%
As mentioned in the following:
https://forums.embarcadero.com/thread.jspa?messageID=902557&tstart=0
https://forum.kanors-emr.org/showthread.php?tid=571&pid=2652#pid2652
The KB4041681 installs version 4.0.9801.1 of msexcl40.dll.
Find prior version (4.0.9801.0) of msexcl40.dll
Place in another directory. They suggest the application directory, but since in the next step you will modify registry to point to this older version, it can probably go anywhere.
Update registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Excel\win32 to point to the location from step 2.
Uninstall these updates(according to your OS) and your code will start running normally
KB4041681 - Windows 7 SP1 and Windows Server 2008 R2 SP1
KB4041690 -Windows Server 2012
KB4041693 - Windows 8.1 and Windows Server 2012 R2
KB4041678 - For me this was the issue
https://support.microsoft.com/en-in/help/4041678/windows-7-update-kb4041678
This problem was introduced by a recent update of Microsoft Office. there are not alternative solutions at the moment.

Deploying Office 2013 Addins on Win Server 2012

I have an Excel 2013 Add-in.
I can't figure out why it won't load through Remote Desktop gateway if the user haven't first logged in through a normal RDP connection.
When looking into the registry on the server it seems office is missing some entries that used to be there such as:
CURRENT_USER\Software\Microsoft\Office\Excel\Addins\
I only got
CURRENT_USER\Software\Microsoft\Office\15.0\Excel\

Resources