Questions tagged [office-automation]

Use this tag for questions related to automating MS Office Products ( Excel, Outlook, PowerPoint, Access, Word, Project, etc. ). Automation in this context means the use of an external software, not an MS Office product, to execute a variety of operations on MS Office products. For questions about macros use the relevant tags for example "excel" and "vba". Do not use this tag if your question is not about automatic control.

Automation in this context means the use of computer systems to execute a variety of operations such as word processing, spreadsheet calculation, database manipulation, etc. without user interruption.

If you have a specific programming question about Excel or Word (or any other product from the MS Office package) and it is not about automating it via external software then use tags like , , , etc.

805 questions
3
votes
2 answers

VB6/VBA Do not Allow COM Add-In to load

I have a VB6/VBA application that hooks into Excel and loads a workbook. It has been working great for many years. We have now upgraded to Excel 2010 and have ran into some issues. After troubleshooting it seems that if i turn off the PowerPivot COM…
sinDizzy
  • 1,300
  • 7
  • 28
  • 60
3
votes
1 answer

What does VB.NET do differently than C# that Excel exits after the console-app ends without releasing anything explicitly?

I've got two .net-6 console-apps: one in C# using Excel = Microsoft.Office.Interop.Excel; Console.WriteLine("Hello, World!"); var xl = new Excel.Application(); var wb =…
t3chb0t
  • 16,340
  • 13
  • 78
  • 118
3
votes
2 answers

VBA Word/Outlook - Customer User Form Cancels Event Handler

I have some strange behaviour from an event handling function for closing a word document. I'm using Word's DocumentBeforeClose event handler in my Outlook module. In the handler, I prompt the user with a message that asks do they want to finalise…
user1357607
  • 214
  • 4
  • 13
3
votes
1 answer

asp.net web service using office 2010 COM

I am writing a web service and would like to change the .docx or .doc to .xps. I'm using office com to help me to save as .xps format as following: [WebMethod] public string GetDocPreviewUrl(string m_userName, string m_orgFileName) …
Kinleong
  • 371
  • 4
  • 14
3
votes
1 answer

can not find Microsoft.Office.Interop.Excel, please help me

in my c# program, i try to use wrtie something to excel. i find a method on the internet, using Microsoft.Office.Interop.Excel class. but when i use Microsoft.Office.Interop.Excel,it said that no Interop class found. i have already had Microsoft…
cloud
  • 505
  • 1
  • 8
  • 21
3
votes
2 answers

Excel (Office) and C#

At the moment I must maintain an Excel-Application, which consists of many VBA-Modules. For me it has the touch like a legacy system and VBA looks like a language of recent days. Makes it sense to think about a migration to C# and a .NET based…
Kottan
  • 4,944
  • 9
  • 41
  • 67
3
votes
0 answers

Insert formatted HTML string in Powerpoint in placeholder using Open XML

I am creating one slide PowerPoint file using open XML. I have tagged the placeholder in the PPT which i need to update programatically. I am able to find the placeholder and can update its value from the database. Now the problem is I need to…
Rohit daga
  • 71
  • 8
3
votes
3 answers

C# converting a VBA For Each loop to C# but gives compile error

I am converting a Word VBA macro to a plugin in C#. I have so far successfully refactored all statements, methods and properties in C#, but this one gives me a hard time: For Each l In Application.Languages If InStr(LCase(l.NameLocal),…
ib11
  • 2,530
  • 3
  • 22
  • 55
3
votes
3 answers

MS Access 2003/2007 VBA - How can I take a date field from a recordset and string the dd-MMM-yyyy format?

i have some VB that uses DAO to grab some data, one field being a date field (as in date of a transaction). its not date/time, just simply date like dd/mm/yyyy. so on an access form i know how to do this, but right now i am working on some excel/ppt…
Justin
  • 4,461
  • 22
  • 87
  • 152
3
votes
1 answer

Access 2013 VBA automating Excel losing windows

I'm supporting an Access application that's been in production for years and the Excel automation part of it stopped working with our Office 2013 upgrade and conversion from .mdb to .accdb. The Access databases contain a reference to Microsoft Excel…
Beth
  • 9,531
  • 1
  • 24
  • 43
3
votes
3 answers

How to test if a OleVariant contains an interface

One of the annoying things with working with Excel through its automation interface is the weak typing. A return value can contain anything different types. How do I test if the variant returned by caller is an ExcelRange interface? function…
Johan
  • 74,508
  • 24
  • 191
  • 319
3
votes
1 answer

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

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…
Jay C
  • 141
  • 1
  • 12
3
votes
2 answers

How to build form completion/document merge application with Winforms or WPF?

I need to build an application that accepts user input data (such as name, address, amount, etc.) and then merges it with a pre-loaded document template (order form) and then prints this merged document. I can use Windows Forms or WPF for this…
Mike
  • 33
  • 3
3
votes
1 answer

Creating Charts with multiple series in Powerpoint 2013 using C#

I am using VS2013 Ultimate, with Office 2013 (PowerPoint, Excel and Word all installed). I am coding in C#. I am creating a PowerPoint presentation using C#. So far, I have managed to accomplish everything that I have wanted to do. However, I am…
Paul Davey
  • 87
  • 1
  • 8
3
votes
4 answers

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

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…
Raymund
  • 7,684
  • 5
  • 45
  • 78
1 2
3
53 54