I am relatively new to VB programming and have a very basic question. I have been using VB with very little knowledge of the nuisances of what I am doing. Basically hack attacks that seem to work, but I want to understand the reasons behind the code now. Can somone tell what the difference is between accessing excel using these two forms. Why you would use one over the other. Some things seem to work using one way and some work using the other.
Set xl = CreateObject("Excel.Application")
Dim wrkbook As Excel.Workbook
Set wrkbook = xl.Workbooks.Open("F:\My Documents\weeklyrpt.xls")
Dim xl As Excel.Application
Set xl = New Excel.Application
xl.Workbooks.Open "F:\My Documents\weeklyrpt.xls"
Set xl = CreateObject("Excel.Application")
Dim wrkbook As Excel.Workbook
Set wrkbook = xl.Workbooks.Open("F:\My Documents\weeklyrpt.xls")
Dim xl As Excel.Application
Set xl = New Excel.Application
xl.Workbooks.Open "F:\My Documents\weeklyrpt.xls"