Microsoft Excel - My Add-In is not working :( - Asked By nancy drew on 31-Mar-11 09:26 AM

I'm using VS2005
Office 2007
MOSS 2007

I changed the columns in my doc library to string fields.

And I created an excel Add In using these instructions:

http://msdn.microsoft.com/en-us/office/Video/bb649501

However, nothing is being updated in SharePoint or Excel.

Visual Studio Code is included

Here is the info from the debugger:

'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Tools.Applications.Runtime\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Tools.Applications.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Office.Tools.Common\8.0.0.0__b03f5f7f11d50a3a\Microsoft.Office.Tools.Common.dll', No symbols loaded.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EXCEL.exe' (Managed): Loaded 'C:\Documents and Settings\<username>\Local Settings\Application Data\assembly\dl3\PWR8XEO6.VVE\1C4K134O.P79\96a4b38f\2eeaad80_f2eecb01\XLContentTypeMapperSPVB.DLL', Symbols loaded.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll', No symbols loaded.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC\office\12.0.0.0__71e9bce111e9429c\office.dll', No symbols loaded.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Office.Tools.Common2007\8.0.0.0__b03f5f7f11d50a3a\Microsoft.Office.Tools.Common2007.dll', No symbols loaded.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Office.Tools.Excel\8.0.0.0__b03f5f7f11d50a3a\Microsoft.Office.Tools.Excel.dll', No symbols loaded.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasic\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EXCEL.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC\Microsoft.Vbe.Interop\12.0.0.0__71e9bce111e9429c\Microsoft.Vbe.Interop.dll', No symbols loaded.
The program '[3996] EXCEL.exe: Managed' has exited with code 0 (0x0).

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
public class ThisAddIn

    Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
        ' Start of VSTO generated code

        Me.Application = CType(Microsoft.Office.Tools.Excel.ExcelLocale1033Proxy.Wrap(GetType(Excel.Application), Me.Application), Excel.Application)

        ' End of VSTO generated code

    End Sub

    Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

    End Sub

    Private Sub Application_WorkbookBeforeSave(ByVal wb As Microsoft.Office.Interop.Excel.Workbook, ByVal SaveAsUI As Boolean, ByRef Cancel As Boolean) Handles Application.WorkbookBeforeSave
        SynchProperties(wb)
    End Sub

    Private Sub Application_WorkbookOpen(ByVal wb As Microsoft.Office.Interop.Excel.Workbook) Handles Application.WorkbookOpen
        SynchRanges(wb)
    End Sub

    Private Sub SynchProperties(ByVal wb As Excel.Workbook)
        Dim props As Office.DocumentProperties = wb.BuiltinDocumentProperties
        Dim ctprops As Office.MetaProperties = wb.ContentTypeProperties

        If props("Content Type").Value.ToString() = "PurchaseOrder" Then
            Dim wsMap As Excel.Worksheet = wb.Worksheets("CTMap")
            Dim wsPurchase As Excel.Worksheet = wb.Worksheets("Purchase Order")
            Dim rg As Excel.Range = wsMap.Cells(1, 1)

            While Not (rg.Value2 Is Nothing)
                Try
                    ctprops(rg.Offset(0, 1).Value2).Value = wsPurchase.Range(rg.Value2).Value2.ToString()
                Catch ex As Exception

                End Try
                rg = rg.Offset(1, 0)
            End While
        End If
    End Sub
    Private Sub SynchRanges(ByVal wb As Excel.Workbook)
        Dim props As Office.DocumentProperties = wb.BuiltinDocumentProperties
        Dim ctprops As Office.MetaProperties = wb.ContentTypeProperties

        If props("Content Type").Value.ToString() = "PurchaseOrder" Then
            Dim wsMap As Excel.Worksheet = wb.Worksheets("CTMap")
            Dim wsPurchase As Excel.Worksheet = wb.Worksheets("Purchase Order")
            Dim rg As Excel.Range = wsMap.Cells(1, 1)

            While Not (rg.Value2 Is Nothing)
                Try
                    If rg.Value2.ToString <> "GrandTotal" Then
                        wsPurchase.Range(rg.Value2).Value2 = ctprops(rg.Offset(0, 1).Value2).Value
                    End If
                Catch ex As Exception

                End Try
                rg = rg.Offset(1, 0)
            End While
        End If
    End Sub


End Class
Ravinder Jamgotre replied to nancy drew on 31-Mar-11 09:34 AM
Have you checked permissions to the excel file and or the sharepoint DL.