Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am wondering if there is a preferred way of creating objects (if that is
the right word). For example, I am using: Dim cnn1 As ADODB.Connection Set cnn1 = New ADODB.Connection I know I could also use: Dim cnn1 As New ADODB.Connection I understand both do the same thing? Are there scenarios where one is preferred over the other, or simply a personal choice? Also, I am more interested in the proper use of "close" and "set object to nothing" In my above code, at the end I have: cnn1.Close Is this all I need to do? Should I also have: Set cnn1 = Nothing Does using close without set = nothing leave anything open? Thanks! Dion |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why excel close all files when I just want to close one files | Excel Discussion (Misc queries) | |||
why do all excel worksheets/workbooks close when I close one? | Excel Discussion (Misc queries) | |||
close button does not close | Excel Discussion (Misc queries) | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel |