Microsoft Excel - My Add-In is not working :(

Asked By nancy drew
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
31-Mar-11 09:34 AM
Have you checked permissions to the excel file and or the sharepoint DL.
Create New Account
help
Auto-populate other cells based on dates Excel Microsoft Visual Basic 6.5 on Microsoft Excel 2002 SP3. I'd like assistance in writing code to auto-populate other cells based date, then time, then city, I would these copy rows into a worksheet named "Scheduler". Excel Programming Discussions Microsoft Excel (1) Worksheet (1) Workbook (1) Slots (1) Times (1) City (1) Day (1) this is
Microsoft Excel Microsoft Excel (full name Microsoft Office Excel ) is a spreadsheet application written and distributed by Microsoft for Microsoft Windows and Mac OS X . It features calculation, graphing tools, pivot tables and a macro
Microsoft Excel Microsoft Excel (full name Microsoft Office Excel ) is a spreadsheet application written and distributed by Microsoft for Microsoft Windows and Mac OS X . It features calculation, graphing tools, pivot tables and a macro
Excel 2003 help file errors Excel When a client accesses Help-Microsoft Excel Help-Table of Contents-Microsoft Excel Visual Basic Reference they are getting a runtime error (see below). KB article number 822521 has A Runtime Error has occurred. Do you wish to Debug? Line: 16 Error: Not implemented Excel Crashes GPFs Discussions Excel (1) Error (1) Workbook (1) Hi, Excel's VBA Help and
How can I make my data show as flashing in Excel? Excel Excel Miscellaneous Discussions Microsoft Excel (1) Excel (1) Application.OnTime (1) Worksheet (1) Workbook (1) Macro (1) VBA (1) Font.ColorIndex (1 if you insist, see Chip Pearson's site for VBA code. http: / / www.cpearson.com / excel / BlinkingText.aspx Gord Dibben MS Excel MVP This was great - thank you. My boss loved it. Now I have another question