Visual Studio Development Bookmark and Share   
 index > Visual Studio Tools for Office > VS Intellisense for VSTO?
 

VS Intellisense for VSTO?

I am working on an add-in for Excel 2007 and everything is working fine except I don't have complete intellisense for the VSTO.  I get it for all normal .Net programming and I get it for the the general Office stuff (e.g. Excel.Range.etc will work).  However, when I try to get down further to specific properties it does not. (e.g. [something].font.bold offers no intellisense ).

Since I am new to VSTO and do not know where thigns are this is really slowing down my progress.  I wanted to check to see if this is normal before I go through a bunch of troubleshooting.  If it is not normal can anyone offer any suggestions?

For an unrelated problem I recently re-installed the VSTO stuff for VS 2008.  That did not help the intellisense, it has worked the same before and after the re-install of  VSTO.

Thanks for any and all help,
Steve
Steve D.
SEC Steve  Wednesday, October 14, 2009 11:13 AM
Hello Steve,

Welcome to MSDN forums!

I think the reason you feel the intellisence is not working is that in Excel Object Mode, many properties is returned as a type of Object, thus, we could only get what properties or methods belongs to Object.
For example if we say:

 private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
        Application.ActiveSheet
        }

ActiveSheet is a Object, actually, the return value is a Excel.Worksheet object, please refer to:
http://msdn.microsoft.com/en-us/library/bb212495.aspx

So we need to explicitly cast ActiveSheet to a Excel.Worksheet:

 (Application.ActiveSheet as Excel.Worksheet ).Creator

Hope this helps you.

Thanks.


Tim Li

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact EMAIL GONE


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Marked As Answer bySEC Steve 12 hours 8 minutes ago
  •  
Tim Li  Thursday, October 15, 2009 6:25 AM
Hello Steve,

Welcome to MSDN forums!

I think the reason you feel the intellisence is not working is that in Excel Object Mode, many properties is returned as a type of Object, thus, we could only get what properties or methods belongs to Object.
For example if we say:

 private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
        Application.ActiveSheet
        }

ActiveSheet is a Object, actually, the return value is a Excel.Worksheet object, please refer to:
http://msdn.microsoft.com/en-us/library/bb212495.aspx

So we need to explicitly cast ActiveSheet to a Excel.Worksheet:

 (Application.ActiveSheet as Excel.Worksheet ).Creator

Hope this helps you.

Thanks.


Tim Li

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact EMAIL GONE


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Marked As Answer bySEC Steve 12 hours 8 minutes ago
  •  
Tim Li  Thursday, October 15, 2009 6:25 AM
Hi,

I am writing to check the status of the issue on your side. Could you please let me know if the suggestion works for you or not? If you have any questions or concerns, please feel free to let me know. I will be more than happy to be of assistance.


Tim Li

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact msdnmg@microsoft.com


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Tim Li  Monday, October 19, 2009 2:31 AM
My apologies Tim,

I got pulled off of this and am on a Sharepoint project for a couple of days. I hope to get back to this tomorrow and try this out.

Sorry about leaving you hanging.


Thanks,
Steve
Steve D.
SEC Steve  16 hours 19 minutes ago
I think that I get it. You have to be really specific. For example:

(forgive my VB)


This did not give me intelllisense:
oRange.Rows(1).Font.Bold = "True"

This did give me intelllisense:

Dim oRow As Excel.Range = oRange.Rows(1)
oRow.Font.Bold = "True"

As did this:

CType(oRange.Rows(1), Excel.Range).Font.Bold = "True"

I am used ot intellisense workiing all the time and everywhere. I am a nvoice develpoer and very spoiledby VS. I sure do like being spoled.


Steve D.
SEC Steve  12 hours 6 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• How do I customize an open template?
• Transferring a DataSet into a VSTO Workbook.
• Problem in installing outlook plug-in with Windows Vista
• How to get notification when Outlook resized for Outlook Addin
• Word to Excel
• How to debug "class not registered" error
• InLineShape LockAspectRatio property
• HorizontalAlignment
• Deployment VSTO SE - Outlook 2007 add-in
• create olap cubes from excel query