Posts

Showing posts with the label VSTO

Why my custom prerequisite is saying it is corrupt?

Error: Verifying file hash Error: Setup has detected that the file '.....XXXXX.msi' has either changed since it was initially published or may be corrupt. Solution: Option 1: Uninstall .NET 4.5 and work with .NET 4.0 only Option 2:   Sign your package files with a code-signing certificate to avoid a defect introduced in .NET 4.5 References: http://stackoverflow.com/questions/13073915/clickonce-prerequisite-error-published-installer-may-be-corrupt http://msdn.microsoft.com/en-us/library/ms165429.aspx

Updating SourceData/ Data Source of the Pivot Table

Image
Errors:  1. Run time error '1004' Cannot Open PivotTable source file https://....[servlet.FileDownload?]... 2. Data source reference is not valid 3. Can not use web data source as pivot data 4.  Run-time error '-2147024809 (80070057)' Item with specified name wasn't found 5.  Error: Cannot open PivotTable source file ‘[filename[x].xls]SourceData’ 6.  Exception from HRESULT: 0x800A03EC   at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)    at CallSite.Target(Closure , CallSite , ComObject , String )    at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)    at CallSite.Target(Closure , CallSite , Object , String )    at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) Solution: We have spend a day searching around for the solution. We ...

VSTO : Creating and retrieving Custom XML part in Excel

Image
Custom XML allows one to store XML in the desired format inside an Office document. For example, if we open Excel Workbook using 7-zip the custom XML folder is right at the root level.  Default Folder Structure string xmlString1 =           "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" +           "<employees xmlns=\"http://schemas.microsoft.com/vsto/samplestest\">" +               "<employee>" +                   "<name>Surender G</name>" +                   "<hireDate>1999-04-01</hireDate>" +                   "<title>Manager</title>" +               "</employee>" +           "</employees>"; Office.CustomXMLPart em...

Worksheet Activate event is not firing

On a fine day, I found that custom task pane is not appearing on activating a worksheet. I could find no error messages in our log4net log and windows logs. I tried to troubleshoot for a while but nothing worked.  Finally, I went back my stable project and started comparing the code. It's found that the following line was commented out.                   Globals.Factory.GetVstoObject(projectPlanSheet); As soon as I have removed the comments and task pane showed up again.  I found that GetVstoObject() generates an extended object which gives access to application level events. Also, check out HasVstoObject().   A short description about extended object Add managed controls to any open document or worksheet Convert an existing list object on an Excel worksheet to an extended  ListObject  that exposes events and can be bound to data by using the Windows Forms data binding model Access application...

Steps to format an Excel table suitable to paste in Word

Create a table style #region CREATE_TABLE_STYLE                     //Creating table Sytle. Unprotect all the sheets. If anyone sheet is protected it will return a COM Exception hresult 0x800a03ec                     foreach (Excel. Worksheet ws in activeWorksheets)                     {                         if (ws.ProtectionMode || ws.ProtectContents)                         {           ...

COM Add-in Deployment Issues

Environment:  Visual Studio 2010, Office 2010, Excel 2010 Error: "Another version of this product is already installed"? Solution: 1.       Try uninstalling the application from "Add and remove programs" 2.       If the above step doesn't resolve the issue, run EXE from the command prompt with /x option 3.       Delete Application cache On Vista, it is located at C:\Users\ \AppData\Local\Apps\2.0 4.       As a last step take a backup of the registry. Search for "DSExcelAdd-in" and delete the corresponding entries. PLEASE TAKE THE BACKUP as needed. (esp. Keys under VSTA and VSTO (HKEY_USERS) Error: Name: From: file:///C:/publish/DSExcelAdd-in.vsto ************** Exception Text ************** System.ArgumentException: Value does not fall within the expected range. at Microsoft.VisualStudio.Tools.Applications.Deployment...