Can VBA interact with other applications?

How to extract data from Chrome to Excel using VBA?

I am using this website to scrape data from a website that has 2 tabs.

Both tabs contain an input field where the user enters a search term and presses search. However, in one tab the search results are shown as a table, in the other tab as a graph. In both cases, the table contains the same data but with different types of information and the graph shows different types of information.

In my VBA code I use the following line: Dim ExcelApp As Object. Set ExcelApp = CreateObject("Excel.Application") However, in the first tab where it shows the table, it returns an error. Object variable or With block variable not set. For the second tab it works fine. I don't know why it doesn't work for the first tab. Can anyone help me? Thanks in advance!

The issue is likely with the application you are calling on. To get around this problem you need to get the Application object first. Set ExcelApp = CreateObject("Excel.Application") Then call your excel app by opening the file through the Application object. ExcelApp.Workbooks.Open("C:Folderfile.xls")
You can also use the Workbooks.Open method to open the workbook as well.Open("C:Folderfile.

Can VBA interact with other applications?

I'm running a VBA macro in Excel that interacts with other applications.

For example, when I click on a button in a web browser it opens an Excel spreadsheet and the macro runs (and then I can interact with the spreadsheet). How do I do something similar in Outlook? Do I need to add some references to the application? Do I have to use COM automation? Or is this just impossible?

Yes, you do need to add a reference to the application (Outlook), but you don't need to use COM Automation. The simplest way is to run a line of code like. Dim objOutlook As New Outlook.Application You then have access to all the standard Outlook functions. But if you need to use COM automation, check out this tutorial.

Related Answers

Can you automate with VBA?

Sure. VBA is the most powerful scripting language available for Windows. A VBA e...

Does Excel 2016 have Macros?

After I used the Microsoft Office Assistant tool to clean up my Excel spreads...

How to extract data from website excel VBA?

For those that may not be familiar with scraping, it's when you collect all...