Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42728

Trying to Understand Excel Automation

$
0
0
So I'm studying the process of Excel Automation so I won't be such a dummy with it and notice this:

Code:

        Dim oXL As Excel.Application
        Dim oWB As Excel.Workbook
        Dim oSheet As Excel.Worksheet
        Dim oRng As Excel.Range

        ' Start Excel and get Application object.
        oXL = CreateObject("Excel.Application")
        oXL.Visible = True

Code:

        Dim oXL As Excel.Application
        Dim oWB As Excel.Workbook
        Dim oSheet As Excel.Worksheet
        Dim oRng As Excel.Range

        oXL = New Excel.Application
        oXL.Visible = True

So what is the difference between these two methods and why would you choose one over the other?

Viewing all articles
Browse latest Browse all 42728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>