SSIS 2008 and Excel Interop assemblies - excel

Have an SSIS 2008 package that runs just fine on my local dev machine with Office 2007 installed. It has a script task with interop.excel as a reference. (I'm reformatting some excel sheets with it)
So everything works like a champ until I install and run it on my test SQL 2008 (Server 2008 64bit) server. I install to SSIS, execute it via a SQL Server Job, it runs though most of the steps but then throws an exception when it gets to the script task that needs the excel interop assembly.
I've installed the 2007 PIA and have execution marked as 32bit as well. At this point I'm just kind of lost. Any help is appreciated.

This script task - Is it a .NET script task or a 32-bit script task?
I'm guessing from the interop.excel reference, that its a .NET script task calling out to an old 32-bit library? Can you confirm?
If there is a 32-bit component that you are running on your Win64 environment then you need to be careful about what you are using to register it. By default, regsvr32 is the 64-bit version, so you need to use the regsvr32.exe under c:\windows\systemWOW64 (or something similar). This will ensure the dll is registered in the 32-bit hive of the registry, and available to the WOW (windows-on-windows) emulation environment.

SpreadsheetGear for .NET is an Excel compatible spreadsheet component for 32 bit and 64 bit .NET, and has an API which is similar to Excel's COM API.
You can see some live ASP.NET samples here and download the free trial here.
Disclaimer: I own SpreadsheetGear LLC

I installed Office 2007 on the server I was using. That fixed one problem. Then I discovered another problem that was alleviated by this SO Link

Related

How to connect Excel file within SSDT-Visual Studio (32-bit) on a Windows Server 64-bit?

How could I read an Excel file with SSDT-Visual Studio 2019 under Windows Server 2016 64-bit ?
I see there are a lot of blogs describing similar issue but I'm still not able to solve my problem.
I would like to read an Excel file within my Visual Studio 2019 (SSDT Toolbox) under our Windows Server 2016 64-bit.
At first attempt (during the development) I got this error message "The requested OLE DB provider Microsoft.ACE.OLEDB.16.0 is not registered. If the 32-bit driver is not installed, run the package in 64-bit mode."
Ok, I understand VS 2019 is a 32-bit app so it, by default, tries to use 32-bit driver.
Through multiple tests I tried the actions below but none of them have solved the issue :
set the Run64BitRunTime as True
set the "Processor Architecture for AnyCPU Projects" as x64
It seems modifying those settings would apply only at RunTime level i.e at the compiled version of the package, not during the development.
When I use SQL Server Import and Export Data Wizard 64-bit (and save the SSIS Package) it do works BUT it does not help reaching 100% of my goal. The reason I use SSIS is to do complex ETL , not only reading an Excel file. Reading such file is only a small part of the process (otherwise SSIS would be quite underutilized)
The biggest constraints I currently have are:
As per company restrictions, we could not install 32-bit driver on that machine
I know Visual Studio 2022 would be 64-bit but unfortunately, at this time (October 2022), it does not have SSIS module yet
Could anyone help me to solve this?
Any helps or tips would be appreciated.
My environment:
Windows Server 2016 64-bit
SQL Server 2019 with SSIS module installed
Visual Studio 2019 with SSDT module installed

SQL Server Management Objects (SMO) Reference in Excel 2010 VBA Project?

Using Excel 2010 using VBA, I would like to be able to start/stop and view running SQL Server jobs, create new tables for import jobs, as well as run backups and other administrative tasks on my local SQL Server. I would also like to use it as a front end for reports for my imported data.
I am trying to locate a reference to SQL SMO but do not see it in Excel Tools -> References. It is installed, I have verified that.
My development environment is:
Windows 7 64-bit
SQL Server 2008 R2 64-bit
MS Office Premium 2010 32-bit
I am aware that this could be done a dozen other ways but I have been trying to get it to work in Excel for days and searching on this combination of programming has yielded nothing except how to do this with SQL DMO (the former object model) which I do not have installed as its deprecated in SQL Server 2008 I understand.
I also tried a direct reference to the Microsoft.SqlServer.Smo.dll file located at C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies which failed with a Cant add a reference to the specified file. error.
Is it possible to gain access to SQL SMO via VBA in Excel or am I out of luck and should move to VB.net / C# etc?
After much research I have found out that it is not possible to consume what is essentially a dot-net, 64-bit, resource from a 32-bit Excel program. I would have to install the 64-bit version of office and give that a try. Perhaps in a VM I shall try.

Microsoft.Office.Interop.PowerPoint + PIA

I have used Microsoft.Office.Interop.PowerPoint in my desktop application.
I want to run its EXE on another machine. Does that machine required MS office to be installed or simply by installing PIA (Primary Interop Assembly) distributable on that machine will do the work?
You need to have the associated office product installed on the destination machine. This is how microsoft makes moneys.
The Interops only invoke functionality from within the Office applications.
http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/thread/b4026f0b-c3a3-4b80-81df-5175e866ae8f

VSTO 2010 excel addins cannot be loaded on target xp machine

I published my excel addins with clickonce on vs2010.
It`s prerequisites contains .net framework 4 client,vsto 2010 and installer3.5.
Deploying it on win7 works well,when I deploy it on xp,installing no error occured,
but it(com) cannot loaded when run excel app.
I tried mang mehods,only when I manually installed .net framework 2.0 or 3.0 or 3.5
my addin will appear
I donot know why.
thanks
Here's a dumb question, when deploying are your users installing the .vsto or the setup.exe (aka bootstrap). If they are installing the just the .vsto file they aren't getting any of the pre-reqs. They live in the setup.exe. Also are you installing the PIAs (or are you using the embedded PIAs which is new to 2010)? Win7 machines tend to have the right pre-reqs but when you go back in time on XP they don't.

Excel UDF formula does not appear

I have an Excel UDF . It is written in C# and the automation addon has been packaged using the Visual Studio setu up project wizard. The addon loads in the list of automation addons available but the formula does not appear in the Insert function formula dialogue box.
I used Office 2003 and Visual Studio 2008 to build the addin. The client machine has .Net Framework 2.0 installed and does not have any installation of VS.
Should I have to enable the udf specifically somewhere ? This problem appears only when I am packaging the addon to distribute it to a client machine.
Thanks,
The fact that the COM add-in appears in the availale list of automation add-ins would imply that the COM add-in has been successfully registered on the target machine.
Could it be a Trust issue? You can check the level of trust your assembly has using the Microsoft .NET Framework Configuration: http://support.microsoft.com/kb/815147
I suspect you'll need full-trust.
I haven't built add-ins with COM for a while (I can list the alternatives if you like), so let me know if this doesn't fix it and I'll look into it further.

Resources