Link to home
Start Free TrialLog in
Avatar of sullisnyc44
sullisnyc44Flag for United States of America

asked on

How to deploy custom Excel Addin (NEWBIE ALERT)

So I successfully created an Excel Addin using these instructions:
http://msdn.microsoft.com/en-us/office/Video/bb649501 

I was following these instructions:
http://clear-lines.com/blog/post/create-excel-2007-vsto-add-in-msi-installation.aspx

until I got to this point:

"Two other files are required with the deployment, the VSTO deployment manifest and application manifest. Let’s add these files, by right-clicking AnakinSetup > Add > Files, and browsing to ClearLines.Anakin > Bin > Release:"

there are no files there.

I know the addin works if I run the debugger in VSTO. but how do I create and deploy it for real?
ASKER CERTIFIED SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sullisnyc44

ASKER

This is new from yesterday... I have some warnings (probably messing around with this too much):
Warning      1      Windows Installer is not included in any selected prerequisite      C:\Documents and Settings\<username>\My Documents\Visual Studio 2005\projects\XLContentTypeMapperSPVB\XLContentTypeMapperSPVBSetup\XLContentTypeMapperSPVBSetup      XLContentTypeMapperSPVBSetup
Warning      2      Two or more objects have the same target location ('[targetdir]\xlcontenttypemapperspvb.dll.manifest')      C:\Documents and Settings\<username>\My Documents\Visual Studio 2005\projects\XLContentTypeMapperSPVB\XLContentTypeMapperSPVBSetup\XLContentTypeMapperSPVBSetup      XLContentTypeMapperSPVBSetup
Warning      3      Two or more objects have the same target location ('[targetdir]\xlcontenttypemapperspvb.dll.manifest')      C:\Documents and Settings\<username>\My Documents\Visual Studio 2005\projects\XLContentTypeMapperSPVB\XLContentTypeMapperSPVBSetup\XLContentTypeMapperSPVBSetup      XLContentTypeMapperSPVBSetup
Warning      4      Two or more objects have the same target location ('[targetdir]\xlcontenttypemapperspvb.dll')      C:\Documents and Settings\<username>\My Documents\Visual Studio 2005\projects\XLContentTypeMapperSPVB\XLContentTypeMapperSPVBSetup\XLContentTypeMapperSPVBSetup      XLContentTypeMapperSPVBSetup
Warning      5      Two or more objects have the same target location ('[targetdir]\xlcontenttypemapperspvb.dll')      C:\Documents and Settings\<username>\My Documents\Visual Studio 2005\projects\XLContentTypeMapperSPVB\XLContentTypeMapperSPVBSetup\XLContentTypeMapperSPVBSetup      XLContentTypeMapperSPVBSetup


I thought I followed all the steps... but I cannot find a *.vsto file anywhere? How is that possible?

Attached is image of my solution explorer... not sure if that will give a clue or two...

I created my addin using this code. Saved it and build it. Then I got stuck at the point in the other instructions above while trying to add to the setup project - there's no vsto project. W

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)
        ' MsgBox("Hello World! Save")
    End Sub

    Private Sub Application_WorkbookOpen(ByVal wb As Microsoft.Office.Interop.Excel.Workbook) Handles Application.WorkbookOpen
        SynchRanges(wb)
        '   MsgBox("Hello World! Open")
    End Sub

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

        If props("Content Type").Value.ToString() = "Purchase Order" 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)
                '          MsgBox(rg.Value2.ToString)
                Try
                    ctprops(rg.Offset(0, 1).Value2).Value = wsPurchase.Range(rg.Value2).Value2.ToString()

                Catch ex As Exception
                    MsgBox(ex.Message)
                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
        '   MsgBox("SynchRanges")
        '   MsgBox(props("Content Type").Value.ToString())

        If props("Content Type").Value.ToString() = "Purchase Order" 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
                    '            MsgBox(rg.Value2)
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try
                rg = rg.Offset(1, 0)
            End While
        End If
    End Sub


End Class

Open in new window

SolutionExplorer.bmp
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks! i would love to upload it but I don't think I'm allowed to upload a zip file. That appears to be the only output when exporting from VS2005?

How else can I get it to you?

I did perform a search for the vsto file on the entire drive and did not find anthing.

Someone told me all I have to do is 'Project/Properties/Publish' ? but I have errors now... probably too much messing with the code and I should probably just recreate everything.
This is what is under my excel addins on my local machine. - just the manifest file.

I will upload the dll as well. XLContentTypeMapperSPVB.dll.manifest XLContentTypeMapperSPVB.dll User generated image
And it works for me... I just need to get it to a few people.
PS THANKS CodeCruiser - I will definitely be reading all of those great resources you provided as well!! thank you
Glad to help :-)
It makes sense to me that if I were creating an Excel Addin in Excel (*.xla) that I would have to copy the files to the xlstart directory...

If I create an Add-In in VS and 'Build' & 'Publish' it I should not have to do much more (from what I've been able to read). And IT DOES work for me.

But if I want to put it on another machine? That's where I'm stuck.

So I did find this...http://msdn.microsoft.com/en-us/library/xc3tc5xx(v=VS.80).aspx

I will give it a shot.
ok and I found this:
http://www.softinsight.com/bnoyes/PermaLink.aspx?guid=bd37cddc-3574-49fc-b226-a7df516ecb43

and even though it is step by step I have a few ?S

Step 1 - move your app files to the target machine.
 - Which files?
This is the release directory of my project:

C:\documents and settings\<username>\my documents\visual studio 2005\projects\XLContentTypeMapperSPVB\XLContentTypeMapperSPVB\bin\Release\XLContentTypeMapperSPVB.publish\XLContentTypeMapperSPVB_1.0.0.0

This is really the only directory I really care about correct?

Has 6 files:
releaseDIR.JPG
How come ClickOnce publishing is greyed out?
ALSO the only way to remove the addin from excel is to remove the registry entries?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.

I think I need to reference this series:

http://www.microsoft.com/downloads/en/details.aspx?familyid=6991E869-8D5B-45F4-91E7-B527BD236F4C&displaylang=en

is that correct?

I'm currently designing this in VS 2005, Office 2007 to create a Excel Add-In to connect to a MOSS 2007 / WSS3 cerver?

I was told that VS2005 was preferable when dealing with MOSS2007

My VS 2008 is barely setup - there is nothing to create office projects/addins.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks

is there a reason why I'm not able to publish with Click Once? does something need to be installed?
I give up
>>>Thanks! i would love to upload it but I don't think I'm allowed to upload a zip file. That appears to be the only output when exporting from VS2005?

>>>I give up

I don't :)

Ok do this. Zip the entire folder and rezip the zip file and then upload it :)

Sid
So let me share with you what REALLY worked...

VS2008 not VS2005, rewriting the addin, following the MSI instructions above, except I had to set the prerequisitie install instructions from the 'vendors web site' as opposed to my applications location.

but I did successfully install this on another machine.

Now I get to do it all over again with real naming conventions and hopefully NO TYPOS.

Thanks for all of your help.