office-automation

Format Excel Chart Background using C#

混江龙づ霸主 提交于 2019-12-11 10:16:40
问题 I can already populate the data into the spreadsheet, create the chart based on the range I select. However, when it comes to formatting the actual chart I feel a bit lost as their are so many options!! It is an xlCylinderBarStacked type chart. I simply need to make the color of the bars a nice light orange and make the background a light blue fading into white at the bottom. Any idea's how to do this? 回答1: Just to close this question off. I played around a little with the properties and the

IIS Cannot Get Access to an Excel File for Users, But is OK for Me. Why?

…衆ロ難τιáo~ 提交于 2019-12-11 02:21:52
问题 I have a program running as a service in IIS in Windows Server 2008 R2. The program has no problem creating a report in Excel. The problem occurs when it tries to get access to the Excel the that it has just created. This gives the users a 80070005 error right at this line of code: Excel.Application excelSS = null; excelSS = new Excel.Application(); <-- Error Because at that point, the program has not tried to get access to the Excel file just yet, I believe the problem is not related to lack

Getting System.Runtime.InteropServices.COMException Error in Server Side Generated Excel

只愿长相守 提交于 2019-12-10 18:04:16
问题 We have a web application that generates excel spreadsheets and run macros on the server side. It then sends them to different individuals via email. It is a part of a legacy reporting style which we are transitioning but still supporting on our new application which we delivered as a website in IIS. I know it is a bad practice to do Office Automation as I saw info from Microsoft that this is not supported. It is also indicated in the answer here opening excel error: System.Runtime

Automation Errors: 800706B5, 80004005, 80010108 appear for internal SAP site scrape

会有一股神秘感。 提交于 2019-12-10 10:08:33
问题 I am writing a macro that will scrape my company's internal SAP site for vendor information. For several reasons I have to use VBA to do so. However, I cannot figure out why I keep getting these three errors when I attempt to scrape the page. Is it possible that this has something to do with the UAC integrity model? Or is there something wrong with my code? Is it possible for a webpage using http can be handled differently in internet explorer? I am able to go to any webpage, even other

Excel VBA Workbook not adding to Object Collection

耗尽温柔 提交于 2019-12-08 10:36:19
问题 I am trying to create a collection of workbooks that will allow me to more easily keep track of all the workbooks that are opened. Because the workbooks will be named differently each time, and because I need to make this work without assuming that Excel has no other workbooks open, I cannot use the index. Therefore I have decided to use a collection. However, I keep getting an error when i put in a second workbook, and I am not sure what is going on. I have set the code up in two modules (I

Word Automation with ASP.NET

倖福魔咒の 提交于 2019-12-08 04:03:29
问题 I have an old application that uses Microsoft Word automation in asp.net and I need to install it on a Windows Server 2012 R2 x64 with Office 2013 Standard x86. I know that Office automation in server technologies like IIS should be avoided but I don't have the green light to rewrite the application at the moment, so I have to take it as-is. Initially I started the application and it gave this error: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000

Errors when calling certain Excel VBA macros from C#

有些话、适合烂在心里 提交于 2019-12-06 02:08:16
I have been struggling and searching on this problem to no avail... I have a few test macros that work perfectly when run from Excel, but either fail or don't work when called from C#, using the interop... I am using MS Visual Studio 2012 (on 64 bit Windows 7) to create a console application that will call the VBA macro TestMacro() written in Excel 2007. Here is the C# code to call the macro: (I basically copied what was done here Run Office Macros by Using Automation from Visual C# .NET ) using System; using System.Collections.Generic; using System.Linq; using System.Text; using System

reasons why excel.exe remains loaded after running a delphi client automation program?

三世轮回 提交于 2019-12-04 19:58:10
问题 I wrote a Delphi program that extracts and consolidates data from several different spreadsheets of a single .XLS file, to a text file for later processing. It is a Delphi 7 console program. An excerpt of the most relevant pieces of code will show you that, apparently, my program is pretty well behaved or at least as much as it needs to be. uses ... ActiveX, ComObj ... ; procedure Fatal(s:string); ... Halt(1); var ExcelApp:Variant; (* global var *) begin (* main program block *) coInitialize

How to get text from line number in MS Word

我的梦境 提交于 2019-12-02 03:54:51
问题 Is it possible to get text (line or sentence) from a given line number in MS Word using office automation? I mean its ok if I can get either the text in the given line number or the sentence(s) itself which is a part of that line. I am not providing any code because I have absolutely no clue how an MS Word is read using office automation. I can go about opening the file like this: var wordApp = new ApplicationClass(); wordApp.Visible = false; object file = path; object misValue= Type.Missing;

Programmatically encrypt Outlook email using Inspector

旧时模样 提交于 2019-12-02 02:21:23
I'm using C# with Outlook Object Model (Redemption is not an option for me due to licensing) and I'm having difficulty programmatically encrypting an email message before sending it. I can successfully get a reference to the CommandBarButton which supposedly represents the Encrypt button (Id 718 according to online examples), but I cannot programmatically depress it. I tried using both the CommandBarButton Execute() method and using SendKeys (not sure if sendkeys is even valid in this context). All debug.writeline statements show that the button is in the msoButtonUp state. I've been playing