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
0
votes
0 answers

Get the row of the active Excel cell in C++

I can't understand why it gives an error - an incorrect value. The task is to write a comment in the selected cell by the excel user.I'm trying to get the row and column of the active excel cell - I get an error.Please help me! ` Variant App, Bks,…
0
votes
0 answers

conditional formatings runs well on vs code bt background color not showing on existing excel file

import pandas as pd df = pd.read_excel('disk.xlsx') def color(value): if value == 'File Uploaded!' : color = 'green' else: return return f'background-color: {color}' df.style.applymap(color,…
S.s
  • 1
  • 3
0
votes
2 answers

Excel not closing using the COM in Python

My Excel workbook not closed by executing the highlighted last statement.But throws the error as below.. My code.... import win32com.client as win32 excel = win32.gencache.EnsureDispatch('Excel.Application') excel.Visible= True excelApl =…
0
votes
1 answer

Cannot rename excel file

Imports System Imports System.IO Imports Microsoft.VisualBasic.FileIO Imports Microsoft.Office.Interop Module Program Dim oxl As Excel.Application Dim owbs As Excel.Workbooks Dim owb As Excel.Workbook Dim osheets As Excel.Worksheets …
0
votes
0 answers

Selecting filtered rows in excel using VB.net

Imports System Imports System.IO Imports Microsoft.VisualBasic.FileIO Imports Microsoft.Office.Interop Module Program Dim oxl As Excel.Application Dim owbs As Excel.Workbooks Dim owb As Excel.Workbook Dim osheets As Excel.Worksheets …
0
votes
2 answers

Confusion in creating excel application object using VB.net: CreateObject vs New

I am facing difficulty in understanding the following concepts. I had posted a question some time back - read through the answers but some things are still not clear. I state my confusion below: My first question refers to the following code…
0
votes
1 answer

Difference between CreateObject and New when opening a new excel application

What is the difference between the following two statements? I was writing a basic VB.net code which creates a new excel workbook and adds a new sheet. Both seem to be doing the same thing: Dim oxl As Excel.Application oxl = New…
0
votes
1 answer

Updating a table "Y" in file "B" with new added rows from table "X" in file "A"

I am trying to create an "instant cloud flow" on Power Automate. Context: Excel file "A" contains a table "X" which gets updated regularly with new rows at the bottom containing new information. Excel file "B" contains a table "Y" with the same…
0
votes
0 answers

How to run advance Macro in excel when cell value changes by formula

Why does code1 work, and code 2 doesn't? The only difference I see is Macro in code 2 is more complex. What I wanted to do Run advance macro automatically when cell value changes due to formula. The formula sums the data in L4 cell, from =J4+K4…
Gmaster
  • 30
  • 5
0
votes
0 answers

using System.Drawing not working in C# when executed in Linux Environment

I am generating an excel programmatically, but it works fine in VS, when I tried automating it and compiling via Linux environment, it shows error. ` using System.Drawing; ws1.View.FreezePanes(2, 1); var allCells =…
0
votes
0 answers

Syntax is correct but showing Subscript out of range (Runtime error 9)

Not sure why I'm getting subscript out of range error on this code but as per my understandings the code is correct. This code was working fine few hours back but now getting this error. Can anyone help on this. Restarted my system several times…
Lal Sahab
  • 17
  • 1
  • 4
0
votes
1 answer

Getting a COM class factory Path not found exception when the path clearly exists

I'm trying to use Microsoft.Office.Interop.Excel library to convert a csv to an xlsx. This is the function I am using public static string ConvertToXlsx(string _sFilePath) { string _newFilePath = _sFilePath.Replace("csv", "xlsx"); …
0
votes
2 answers

Office Script with Power Automate to Dynamically Change Excel Worksheet Date

I am using the following office script to hide a daily excel worksheet at the end of the work day. It runs fine when run from the script in excel, however, it fails when triggered by Power Automate at the end of the day using 23:00 EST. I believe…
0
votes
1 answer

How do I use an Outlook macro to connect to an excel file that's already open?

I'm trying to write a Macro that will refer out to a file I use to track credits(I call it Master6 below). In the code excerpt below I try to do some initial testing like, see if excel is even running, or if the Master6 file is already open. I'm…
0
votes
2 answers

How can I turn on Data/Filter mode on Excel sheets from MATLABvia ActiveX?

My MATLAB code produces data that I want to send to Excel. I use ActiveX Server in MATLAB to both produce the Excel file and to do the export (I can control more properties of the resulting Excel file this way than by using the 'writetable'…
myotis
  • 393
  • 4
  • 16
1 2 3
8 9