Questions tagged [excel.application]

Use to focus your question on the use of an Excel.Application object outside of Excel's own VBA. Constructing an independent instance of Excel can present unique problems and this tag can be used to identify them. Examples: PowerShell or VB Script referencing and manipulating an Excel workbook; MS Access building a workbook without leaving its own VBA environment, etc. Should be considered a sub-category and used for focusing a question.

Excel is arguably the most popular of the applications within the MS Office suite; even more so when introductory programming is considered a factor. Excel workbooks and worksheets can be easiy manipulated outside of the native Excel environment by introducing an instance of an Excel.Application object and using that object to programmatically handle data retrieval, creation or modification.

This presents unique problems, particularly in addressing parent/child relationships that are taken for granted in a native Excel environment. Use this tag to focus attention on these issues when you are using an independent instance of the Excel.Application from an outside calling process.

Typical examples of outside calling processes would include , or even each of which can construct an instance of an object and use it to wrangle the data stored in a workbook/worksheet.

References:

36 questions
0
votes
0 answers

I can't start an Excel instance via VBA when declaring a variable as Excel.Application, but can if it's declared as an Object

We recently upgraded from Inventor 2017->2021 and now some VBA code doesn't work anymore. It all comes down to not be able to not correctly start an Excel.Application (but also Word or Powerpoint) via VBA from Inventor. See the code examples…
0
votes
2 answers

MS Access not able to open and assign Excel objects

Excel file won't open in MS Access. This piece of code was working until a few days ago. Now it's NOT erroring out and it's not creating any Excel objects. Dim XL As Object Set XL = New Excel.Application XL.workbooks.Open(ourPath) The Object…
user6879637
  • 41
  • 1
  • 3
0
votes
1 answer

Python - win32com.client: pywintypes.com_error when trying to open a (large) Excel

I´m trying to use the win32com.client to open a password protected excelfile. The file has 37 columns and 28.140 rows. I need to keep the number of rows dynamic as future files will have a different number of rows (both more or less). I found a…
mgruber
  • 751
  • 1
  • 9
  • 26
0
votes
1 answer

Excel.Application: Microsoft Excel cannot access the file '[]' There are several possible reasons:

I have a PowerShell script that works, it helps me run multiple queries against multiple servers and save each output in different CSV and then merge them together into an Excel file. $Servers = get-content -Path "Servers.txt" …
0
votes
2 answers

Merge multiple CSV into one without using Excel.Application

I created a PowerShell script that allows me to merge multiple .CSV into one .XLSX file. It works well on my computer: $path = "C:\Users\Francesco\Desktop\CSV\Results\*" $csvs = Get-ChildItem $path -Include *.csv $y = $csvs.Count Write-Host…
Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113
0
votes
1 answer

How do I open an invisible Excel session from Access via VBA?

I am sorry to pose this seemingly simple question, but I have read many proposed solutions on how to open an invisible Excel window via VBA, but none of them have been specifically about doing it from Access, nor have any of the proposed solutions…
dpberry178
  • 558
  • 6
  • 21
0
votes
1 answer

How to load powerpivot data model with multiple tables?

I need to create an Excel application based on some tables. I ran the code in VBA and it worked. In "Visual Studio" it doesn't work. My code here: Dim xlApp As Excel.Application xlApp =…
Edson Mota
  • 11
  • 5
0
votes
1 answer

Combining two .xlsx worksheets in separate xlsx files into a single worksheet in a new workbook

I need to accomplish this with vbscript (not vba). I cannot find any examples of how to do this. I've got vbs that does all of the major processing to the Excel files I need, but the last piece I need is simply to merge both worksheets which…
user3108489
  • 363
  • 1
  • 4
  • 15
0
votes
2 answers

Unknown runtime error when running macro

I needed a way to schedule automatically opening an Excel file, refresh the contents then save and close it. I have done this before but I can no longer open the file as opening it causes the macro that refreshes then saves and closes the file to…
0
votes
1 answer

open and save a xltm file

I've used some code in VBScript to open a .xlsm file and save that file. Now I want to do the same thing as a .xltm file. I've tried to open the xltm file with script, it works fine. While saving that file, it refers the default location and default…
Maya
  • 27
  • 4
  • 11
0
votes
1 answer

Unable to get the SpecialCells Property of the Range class

I am trying to get the filtered rows count in the excel sheet.But I am trying below mentioned error : Unable to get the SpecialCells Property of the Range class. strPath="C:\Users\PSin\Desk\CodeInven.xlsx" Dim…
Praveenks
  • 1,436
  • 9
  • 40
  • 79
0
votes
2 answers

Why do I get "not defined" on all the Excel objects even after importing Microsoft.Office.Interop.Excel (VB.NET)?

I've got this code: Imports Excel = Microsoft.Office.Interop.Excel Public Class FormExcelTest_VB Private Sub ButtonCreateExcelFile_Click( sender As Object, e As EventArgs) Handles ButtonCreateExcelFile.Click Dim xlApp As New…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
0
votes
1 answer

How to read .xls in a webpage running in IIS7?

I am trying to read as web-page content an excel file. I thought going through vbscript in classic ASP. But ...The code is taking so long to open and when it works, the page comes in blank! That should I do please? <% Dim xls …
0x69676f72
  • 31
  • 5
0
votes
2 answers

Transferring data between Excel sheets

This is my script which opens Excel files and takes info from some cells then inserts it in another Excel document. I have included the entire script but marked where I think the error is. I am really confused at why this isn't working as I am using…
WR D
  • 39
  • 11
0
votes
0 answers

VBScript - Reading data from excel list

I have a couple of questions on reading data from excel sheet using vbscript code and storing them in a dictionary object. 1) This is more excel specific. Can I do Data filtering on an excel based on what I select in a master column. For Ex: I have…