Beginning VSTO Development

Yeah, it can get confusing, especially given the skip-level naming conventions, etc. Essentially, you’ll need: Full version (not Express) of Visual Studio and the .NET version you’re targetting. One of the VSTO run times (VSTO 2003, VSTO 2005, VSTO 2005 SE, VSTO 2008, VSTO 2010). For what your asking, VSTO 2005 SE is probably your … Read more

Query excel sheet in c#

The Select-command should look like this if you want to read A1 to D1: SELECT * FROM [SHEETNAME_HERE$A1:D1] Whole Code: OleDbConnection con = new OleDbConnection( “provider=Microsoft.Jet.OLEDB.4.0;data source=” + XLS_FILE_NAME_AND_PATH_HERE + “;Extended Properties=Excel 8.0;”); StringBuilder stbQuery = new StringBuilder(); stbQuery.Append(“SELECT * FROM [” + SHEETNAME_HERE + “$A1:D1]”); OleDbDataAdapter adp = new OleDbDataAdapter(stbQuery.ToString(), con); DataSet dsXLS = … Read more

Set data type like number, text and date in excel column using Microsoft.Office.Interop.Excel in c#

To set a range to text: xlYourRange.NumberFormat = “@”; You can also prefix a value you put in a cell with an apostrophe for it to format it as text: xlYourRange.Value = “‘0123456”; To set a range to number xlYourRange.NumberFormat = “0”; Obviously if you want to set the format for the entire column then … Read more

Procedure Too Large

You probably have one or more gigantic procedures/functions and I think VBA has a limit of 64k or something per procedure. You fix it by splitting that procedure up into multiple procedures that can then be called by the one procedure. So instead of having: Sub GiantProcedure() … ‘ lots and lots of code End … Read more

Outlook – Read another user’s calendar

Calendar delegation is a feature of Exchange, the Graph API and Outlook API do not allow the user to access the delegated calendar. Currently, the alternative workaround could be use the EWS. And here is an sample for your reference: static void DelegateAccessSearchWithFilter(ExchangeService service, SearchFilter filter) { // Limit the result set to 10 items. … Read more

Why are cookies unrecognized when a link is clicked from an external source (i.e. Excel, Word, etc…)

This is because MS Office is using Hlink.dll component to lookup if the link is Office document or something else. MS Office expect to open the document linked within documents without the aid of external browser (using Hlink.dll component of IE6). If session cookie protects website Hlink naturally is being redirected to login page and … Read more

tech