Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of memory

Status
Not open for further replies.

amrit1020

Programmer
Joined
Sep 26, 2006
Messages
6
Location
US
I have excel file LTRIIIFPlots.xls and it has the following macro. I call it through another application. It works good, only problem when i go back to LTRIIIFPlots.xls, it gives me 'Out of memory' Error and i see the VBE has VBA project open twice.
Please tell what modication is required so that i dont get this error.
Thanks,
Amrit




Sub ReadData(stRUNID As String)

Dim cn As ADODB.Connection
Set cn = New ADODB.Connection

With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=\\wknt02\mtprod\Executables\Test Specific\IIIF\LTRIIIFPlots.xls;" & _
"Extended Properties=Excel 8.0;"
.Open
End With

cn.Close
Exit Sub

 
Does setting cn = Nothing after you close it help? Good Luck!

Have a great day!

j2associatesNO_SPAM@gmail.com
 
No, it doesnot work.
Thanks
Amrit
 
Don't know much about this but it looks like the sub is calling itself.
 
not meaning to be funny - but do you have a "End sub" at the end of that? Exit is fine but I think you'll need to end it as well.
Cheers
 
Yes I have End Sub, I am sorry that was the mistake in posting.
Thanks,
Amrit
 
The problem got resolved by making the 2 different xls application 1 for data and other for macros.
Thanks,
Amrit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top