Code Project

Link Unit

Thursday, March 06, 2014

SQL Agent + Excel issue

We have a SSIS package which is suppose to execute macro. This SSIS package works fine when it is executed from the development environment but fails with following message when package is scheduled as job.


System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot access the file 'XYZ.xls'. 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.


Solution/Workaround:
it is a workaround for a bug in Windows:

1. Create directory "C:\Windows\SysWOW64\config\systemprofile\Desktop " (for 64 bit Windows) or "C:\Windows\System32\config\systemprofile\Desktop " (for 32 bit Windows)
2. Set Full control permissions for directory Desktop (for user "SYSTEM")

Please do this for both 32 and 64 bit folder.

Hope it helps
 

Thursday, September 05, 2013

SQL Server Configuration Manager – Cannot connect to WMI provider – Invalid class [0x80041010]





SQL Server Configuration Manager – Cannot connect to WMI provider – Invalid class [0x80041010]

Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager. Invalid class [0x80041010]






Occasionally, during setup, some .mof (Managed Object Format) files don't get installed or registered correctly.  There is a program called mofcomp that is responsible for registering and storing the data associated with .mof files.  If the .mof file information becomes damaged or compromised, or never installed correctly, the problem will result in an error message like above:



Solution:

Mofcomp "%programfiles(x86)%\Microsoft\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof"