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
5
votes
4 answers

Excel VBA SendKeys not causing IE 9 to save download

I am writing a macro to download a csv file from my company's internal website. For many reasons I can't use any xmlhttp objects. The macro will download the file. The problem is Internet Explorer 9 prompts the user with Open, Save, and Cancel…
derigible
  • 964
  • 5
  • 15
  • 32
4
votes
2 answers

references in C# and unexpected results

I'm relatively new to C# and Office automation and recently I found myself trying to obtain a reference to someone's Outlook inbox and sorting the emails by Received time. It wasn't working until I found a solution elsewhere on the web where the…
public wireless
  • 767
  • 8
  • 20
4
votes
2 answers

MS office interops appear not to work in .NET 6. Cannot open documents

Struggling to open Office files from a C# application, .NET 6. Note this works just fine using .NET framework. The official MS nuget package Microsoft.Office.Interop.Word appears to support only up to Office 2016. Adding the Microsoft Word 16.0…
jwilo
  • 152
  • 1
  • 9
4
votes
5 answers

Problem positioning window when using SetParent()

I'm trying to set childForm as the child of the main Excel window using the SetParent API through PInvoke: Form childForm = new MyForm(); IntPtr excelHandle = (IntPtr) excelApplication.Hwnd; SetParent(childForm.Handle,…
G S
  • 35,511
  • 22
  • 84
  • 118
4
votes
1 answer

Grant read permission for MSysObjects

I need to get the metadata of some hundred MS Access DBs, so I need to automate the process of metadata gathering. I want to query stuff described here, but before I can query the DBs I need read access to MSysObjects tables. I Keep getting…
rammy
  • 43
  • 1
  • 4
4
votes
0 answers

Microsoft Office interop Word Vs Microsoft Office Object Library

I'm searching for an alternative to Microsoft.Office.interop.Word.dll(Works grea in my Windows 7 but chashes in Windows Server 2008 R2). In many articles in here I see people talking about Microsoft Office Object Library. What is the difference to…
Nelssen
  • 1,023
  • 1
  • 17
  • 42
4
votes
1 answer

Call was rejected by callee PowerPoint Automation

I have a commandbar model which automates PowerPoint. I recently faced a strange problem that when PowerPoint is opened through my application, and the data is being loaded through my application to populate the menu. If a user right clicks on…
Aneef
  • 3,641
  • 10
  • 43
  • 67
4
votes
2 answers

Errors when calling certain Excel VBA macros from C#

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…
Sunny Sampath
  • 133
  • 2
  • 7
4
votes
1 answer

Automation for Generating Reports

We are using Stata to combine and analyze data for all of our agencies in a district each month. I'd like to somehow create reports of the data analysis automatically for these monthly reports. The report includes a summary table of the reported…
4
votes
1 answer

How can I avoid Excel show Save dialog when automation app exits

I have a excel automation application written in Delphi, that accesses a given excel workbook and extracts applying some internal logic different data of the sheets. It has worked perfectly for years on Excel 2003 and 2007. Recently some users…
PA.
  • 28,486
  • 9
  • 71
  • 95
4
votes
1 answer

Printing with advanced options (tray selection, duplex, staple)

We have a project of managing printing documents. At first I wonder why printing options couldn't be set up in single place. For example printer tray selection for first page and for other pages can be done using MS Word automation: var doc =…
Sasha
  • 8,537
  • 4
  • 49
  • 76
4
votes
0 answers

Merge altchunk content into docx source

In short: How can I merge the content of altchunks into the docx source files, to prevent problems opening a docx that has too many altchunks? Background: I have a docx file with 5,000 altchunks that were dynamically inserted when the file was…
Keith
  • 20,636
  • 11
  • 84
  • 125
3
votes
3 answers

Check for hung Office process when using Office Automation

Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it?
rjzii
  • 14,236
  • 12
  • 79
  • 119
3
votes
1 answer

VBA Images lost when inserting one word document into another

I am producing reports that are comprised of 4 chapters, an introduction chapter and 3 dynamically created chapters. The 3 dynamic chapters are produced separately, and then inserted after the introduction chapter and saved as a single unit. The…
GSkurski
  • 41
  • 1
  • 4
3
votes
1 answer

excel add in to save internal data?

I am new to writing excel add-in (in C#) and trying to figure out the right way to save some internal data structures so I can restore the state the next time file is opened. I can convert data in xml or base64 strings if it makes things easier. I…
1
2
3
53 54