Questions tagged [excel-automation]

Use of Excel components and functionality from code, instead of using the GUI

Excel components can be controlled by programs. VB can do it directly and actually all Excel macros are written in that language. But also, using COM-automation, you can use Excel functionality from programs written in many other languages.

126 questions
11
votes
2 answers

Passing value to excel inputbox from VB.NET

I am trying to automate data population on some excel sheets that have some macros. Now the excel is protected and I cannot get the secret key. Now I am able to run the macros but when I try to pass arguments I get arguments mismatch. If I just run…
Shouvik
  • 11,350
  • 16
  • 58
  • 89
9
votes
2 answers

Trying to exit C# Excel Workbook without a dialog box

I am using Microsoft Office Interop to edit some excel files and when I close them I use outputExcelWorkBook.Close(false, paramMissing, paramMissing); But a dialog box still comes up, even though I passed false as the first parameter. I have also…
azrosen92
  • 8,357
  • 4
  • 26
  • 45
5
votes
1 answer

Automation Error when invoking method on WCF mex Moniker with Excel

I successfully created a service moniker as client for my WCF service. But I'm unable to call any method on the moniker. At the WCF service end I have a dummy method named TestMethod, as follows: Public Function TestMethod(ByVal TestValue As…
Pradeep Kumar
  • 6,836
  • 4
  • 21
  • 47
4
votes
0 answers

How to insert Calculated fields in pivot table using EPPlus?

i am able to create a new pivot table and add row fields, data fields etc. using Epplus but when i try to add some calculated fields in pivot table which takes some formula , Epplus doesn't give any option. Is there any way to add calculated fields…
4
votes
1 answer

Python - save different sheets of an excel file as individual excel files

Newbie : I have an Excel file, which has more than 100 different Sheets. Each sheet contains several tables and charts. I wish to save every sheet as a new Excel file. I tried many python codes, but none of them worked. Kindly help in this.…
Aditya
  • 615
  • 3
  • 12
  • 26
3
votes
1 answer

ExportAsFixedFormat's IgnorePrintAreas parameter seems not to have effect

In a Delphi application I am using since years the following code to export xlxs to pdf: function TExportTool.ExportExcelToPDF(aFileName, aNewFileName: String): Boolean; // reference :…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
3
votes
2 answers

VB.Net Excel Automation how to handle Sensitivity Labels

When I'm creating an Excel file for a user in VB.Net, I am getting an error ("You can't perform this action when the file is read-only") when I try to save the file and it seems to be because a Sensitivity Label hasn't been chosen. I haven't been…
Tim F
  • 119
  • 1
  • 8
3
votes
1 answer

Application using Microsoft.Office.Interop.Excel to open excel file conflict with RDP sessions on the server

I have a strange behavior started occurring recently on Windows Server 2016/2019. I performed tests using different versions of Excel (2016, 2019, 365) and the issue happened randomly when a remote desktop session is opened on the server (some RDP…
3
votes
1 answer

Releasing Excel COM objects

I have some Excel automation code that uses Excel COM objects. From other SO posts I know that one should do the following to release objects at the earliest convenience: Excel.Range rng = GetSomeRange(); // do something with…
Pat Mustard
  • 1,852
  • 9
  • 31
  • 58
2
votes
2 answers

What is the FileType number for PDF in Excel 2007 that is needed to save a file as PDF through the API?

I need to call a function in order to save an Excel workbook. I installed the PDF save addon for Excel 2007 but now I need to know what the number code is for the file format for when I save the excel file. An example of the excel file format…
2
votes
1 answer

Using pattern matching to match an array with a non-zero lower bound

I'm writing code that calls Excel macros via COM Automation. There is a need to handle different return types and pattern matching is perfect for that: var result = ExcelApp.Run("MyMacro", ...); return result switch { object[,] array => ..., …
Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
2
votes
1 answer

How to convert all columns to Text, while using TextToColumns, by default it was in General format - Using Powershell

I need to split texts using delimiter |.But after split its truncating front zeros: Input 0001|00030455|testing 0003|00004532|testing Expected Output 0001 00030455 testing 0003 00004532 testing Getting Output like this 1 30455 testing 3 …
2
votes
1 answer

Print Timesheet PDFs

So my wife manages the timesheets for her employers company and has to print a pdf timesheet for each employee that worked on client A's project 1. For instance: Client A - Project 1 - Employee 1 - Time & Expenses Client A - Project 1 - Employee 2 -…
Wes
  • 33
  • 2
2
votes
0 answers

Excel 2019 - ADODB connection from VBA stopped working

I have a problem here with the new Office 2019. The Microsoft help pages have absolutely no relevant information about it. Looks like the same connection string that was used in Office 2010 does not work with 2019 anymore. On machine running the…
Slava S.
  • 31
  • 1
  • 6
2
votes
1 answer

VB6 Automation Error when calling Add on previously created MultiPage

I want to generate a bunch of MultiPages and create new Pages dynamically in my app, but i'm getting Run-time error '-2147417848 (80010108)': Automation error The object invoked has disconnected from its clients. Steps to reproduce In a Class Module…
iamanigeeit
  • 784
  • 1
  • 6
  • 11
1
2 3
8 9