vsto

Spreadsheet Compare (Office 2013) automation from .NET application or VSTO add-in

百般思念 提交于 2019-12-04 08:39:48
Is it possible to automate the new Spreadsheet Compare tool of Office 2013 from a .NET application or a VSTO Excel add-in by embedding some Microsoft assemblies? A similar question was asked for VBA programming and the response was no. I managed to execute the application "C:\Program Files (x86)\Microsoft Office\Office15\DCF\SPREADSHEETCOMPARE.EXE" in command-line with a text file as input argument containing two workbooks paths in separate lines, but it would be easier to call a method directly from the code, as for the other functions of Excel. I wrote a simple batch script that allows

Creating a (ClickOnce) setup for VSTO Outlook Add-in

半世苍凉 提交于 2019-12-04 07:35:53
So I created an Outlook Add-in and used the click-once setup to deploy it. The setup runs fine when the user is administrator, but otherwise: no go. Running the setup with "run as..." and logging in as admin works, but than the add-in is installed under the admin, not the current user. The addin doesn't show up in outlook. I tried following this guide: http://blogs.msdn.com/mshneer/archive/2008/04/24/deploying-your-vsto-add-in-to-all-users-part-iii.aspx But I get stuck at part I: http://blogs.msdn.com/mshneer/archive/2007/09/04/deploying-your-vsto-add-in-to-all-users-part-i.aspx I follow the

VSTO Debug version fine, Installed version doesn't read app.config

瘦欲@ 提交于 2019-12-04 06:30:44
I have a VSTO Excel 2007 add-in that should read connectionstrings from the app.config file, and then let the user decide which database to connect to. This works fine when I debug it, but when I run the deployed version (done with Windows Installer) the connectionstrings aren't read at all. I have added the primary outputs from all the projects to the setup project. The app.config file is in the ExcelAddIn project, but not under the Excel heading. The class that manages the connectionstrings is in another project. Here is my app.config file: <?xml version="1.0"?> <configuration>

How to find the named range of a cell - VSTO

微笑、不失礼 提交于 2019-12-04 06:17:24
I have generated a series of rows using C# and VSTO. I have basically loaded a couple of rows with data and have given each cell a NamedRange. My question is how would I, knowing the beginning row and end row index, traverse each cell and retrieve it's NamedRange. I've tried Excel.Range range = (Excel.Range)m_worksheet.Cells[x,y]; which gets the range fine, but then when I do a range.Name.ToString(); I get "System.__COM...." instead of the name. Can anyone assist? Thanks shahjapan Here is the sample code ( take from here ) how you can iterate through named range in Excel. private Excel

Wait Cursor in VSTO word add-in application

可紊 提交于 2019-12-04 06:13:56
问题 I am creating a VSTO word add in. i'm starting a long elaboration from ThisAddin and i would like to change the cursor to WaitCursor, so if I go to Globals.ThisAddIn.Application, there is no cursor property and i've tried with Cursor.Current = Cursors.WaitCursor; when starting the elaboration, and Cursor.Current = Cursors.Default; at the end of the elaboration, but doesn't work, the cursor doesn't change. Any ideas on how to do this? 回答1: private static void SetCursorToWaiting() { Microsoft

How can I get the Range of filtered rows using Excel Interop?

最后都变了- 提交于 2019-12-04 05:12:56
I'm using Excel Interop assemblies for my project, if I want to use auto filter with then thats possible using sheet.UsedRange.AutoFilter(1,SheetNames[1],Microsoft.Office.Interop.Excel.XlAutoFilterOperator.xlAnd,oMissing,false) but how can I get the filtered rows ?? can anyone have idea?? Once you filtered the range, you can access the cells that pass the filter criteria by making use of the Range.SpecialCells method, passing in a valued of 'Excel.XlCellType.xlCellTypeVisible' in order to get the visible cells. Based on your example code, above, accessing the visible cells should look

c#: programmatically create a “named range” in worksheet scope

二次信任 提交于 2019-12-04 04:44:04
问题 How can we create a 'named range' that has its scope set to a worksheet ? (as we can do this manually from Excel, I guess there is a way to this in code) Setting a name using the ' Range.Name ' property creates a workbook-scoped named range. I tried prefixing the range name with '<Sheet Name>!' as suggested here, but it doesn't work. The name doesn't get set at all that way. Any idea as to how this can be done in C#? Update (2013/05/16): Answer by shahkalpesh worked. The original code (in VS

Excel range Style: specifying Borders via VSTO doesn't work

送分小仙女□ 提交于 2019-12-04 04:29:06
问题 Instead of formatting ranges by setting individual formatting properties one by one, I am trying to use Excel Styles, because it seems to be faster at formatting large numbers of cells. I define a Style once, and then apply it to Ranges like this: var cell = worksheet.Cells[row, column]; cell.Style = "MyCustomStyle"; It works perfectly for Interior Color and Font, but I am running into weird issues when trying to work with Borders. When I try to define what borders to show on a range, and how

how do I make my application read the application config instead of machine.config?

不羁岁月 提交于 2019-12-03 21:14:04
问题 I have an word add in application created in c# which is accessing a web service and is perfectly working if installed outside Program Files folder. the weird thing is that when I install this in Program Files folder, the client is failing to read the config in [application].dll.config and raising an error like below: "Could not find default endpoint element the references contract [..] in the ServiceModel client configuration section. This might be because no configuration file was found for

Is it possible to register a .NET assembly for COM interop without adding registry entries?

冷暖自知 提交于 2019-12-03 20:57:16
问题 I am deploying a .NET VSTO application via click once. The application's main assembly needs to be registered for COM interop as part of the installation process. I know that this can be done by writing code to execute "REGASM assembly.dll /tlb", but the problem is that the target workstations that will be installing my application don't have administrative rights, so the regasm fails when trying to register the type library. My question is, how can I register my .net assembly for com