none
Help and some explanation how to get a Microsoft.Office.Tools.Excel.Worksheet host item that extends the functionality of the current Microsoft.Office.Interop.Excel.Worksheet object RRS feed

  • Question

  • Hello,

    I would use some help and more info about how to get host object that extends the functionality of my current Interop.Excel.Worksheet object. I read this artical: https://msdn.microsoft.com/en-us/library/ee794671.aspx where I can call this function GetVstoObject to get host object. But I see that here I need to pass the Globals.Factory object as second parametar. Can someone give me more details about that parameter and how to access it? I would like to get host object so I can access extension property, since my interop excel worksheet doesn't have it.  

    I am using Visual Studio 2013 for developing Excel addin. Using Excel 2010.

    Thanks in advance for help.

    Regards,

    Zeljka

    Tuesday, March 17, 2015 4:02 PM

Answers

  • Hi Zeljka,

    >>I am using the Microsoft Office PIAs, so my question is how to access this automatic generated class Globals in my case?   <<

    Sorry, I am not able to understand the application you were developing exactly. From the orgnal post, you were developing an application level add-in, however based on the description above, it seems that you were building an console or Windows form application to automate Office application.

    If you were developing Office automation, the host item can't work for this secnario since it should run under the VSTO runtime.

    If I misunderstood, please feel free to let me know.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by ZeljkaR Wednesday, March 18, 2015 3:42 PM
    • Unmarked as answer by ZeljkaR Wednesday, March 18, 2015 3:42 PM
    • Marked as answer by ZeljkaR Wednesday, March 18, 2015 3:42 PM
    Wednesday, March 18, 2015 12:17 PM
    Moderator

All replies

  • Hi ZelijkaR,

    Based on the description, you want to get the host item in VSTO add-in. The method in the document is used for the document level customization.

    To get the host item in an application level add-ins, we can use Globals.Factory.GetVstoObject to achieve the goal. You can get more detail about this topic from link below:
    Extending Word Documents and Excel Workbooks in Application-Level Add-ins at Run Time

    Global Access to Objects in Office Projects

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 18, 2015 2:17 AM
    Moderator
  • Hi Fei,

    thanks for your reply. I have seen this articles already too. Maybe I should give some more information. I am using the Microsoft Office PIAs, so my question is how to access this automatic generated class Globals in my case?   

    Regards,

    Zeljka

    Wednesday, March 18, 2015 11:33 AM
  • Hi Zeljka,

    >>I am using the Microsoft Office PIAs, so my question is how to access this automatic generated class Globals in my case?   <<

    Sorry, I am not able to understand the application you were developing exactly. From the orgnal post, you were developing an application level add-in, however based on the description above, it seems that you were building an console or Windows form application to automate Office application.

    If you were developing Office automation, the host item can't work for this secnario since it should run under the VSTO runtime.

    If I misunderstood, please feel free to let me know.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by ZeljkaR Wednesday, March 18, 2015 3:42 PM
    • Unmarked as answer by ZeljkaR Wednesday, March 18, 2015 3:42 PM
    • Marked as answer by ZeljkaR Wednesday, March 18, 2015 3:42 PM
    Wednesday, March 18, 2015 12:17 PM
    Moderator
  • Hi Fei,

    You understood me correct, sorry for not being clear in my first post. That is what I wanted to know. Thanks you for your help  and fast reply. 

    Regards,

    Zeljka

    Wednesday, March 18, 2015 3:47 PM