Solved

Why do I get "System Resource exceeded" when I linked second & successive Excel tables

Posted on 2004-04-23
3
1,500 Views
Last Modified: 2007-12-19
Public Sub Per_VatCodeData(ByVal Period As Long, ByVal CoyCode As String, ByVal VatCode As String, ByVal VatBook As String)

Dim tdfLink As TableDef
I need to use SQL to append data to a series of Excel sheets which I was trying to link to an Access MDB using the following fragment of code in a repeatedly executed Sub:
****************************
Set tdfLink = CurrentDb.CreateTableDef("tblVatSheet")
tdfLink.Connect = "Excel 8.0;DATABASE=" & VatBook
tdfLink.SourceTableName = VatCode & "dyn"
CurrentDb.TableDefs.Append tdfLink         <------------------------------------------------ Stops here

str = Xql_RecordSet(VatCode)
DoCmd.RunSQL str

Set tdfLink = Nothing
CurrentDb.TableDefs.Delete "tblVatSheet"
*************************
Unfortunately, although it works once, it subsequently stops with the error 3035 and message "System Resource exceeded".
Am I doing something wrong? Does anyone have a solution? This should be the fastest way of doing what I wish, if only .....

Thanks
0
Comment
Question by:TonyWootton
3 Comments
 
LVL 11

Accepted Solution

by:
phileoca earned 100 total points
ID: 10901507
0
 

Author Comment

by:TonyWootton
ID: 11396475
Hi phileoca,

Although I am grateful for your response and I've looked at both the questions you refer to, whilst the error message I get is the same, I don't think that the cause is. Since I asked it, I've tried linking all of the sheets before populating them. That worked for all 22. I am then able to write to the first attached sheet, but then to no others. I am subsequently unable to even open any of the attached sheets, least of all to write to them. My suspicion is that there is some kind of problem with the DAO/ODBC mechanism, though I have no idea what and I have been unable to find away to correct it.

I therefore tried another route, by using automation to make Access control Excel which then sucks data out of Access. A somewhat roundabout route, except that it works quite quickly until Excel doesn't quite terminate properly (see Q_21029622.html). Fortunately I've found a workaround


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question