LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Access Automation to Excel

I am an Access Programmer using automation to populate
Excel named ranges by looping thru an Access Recordset.

The procedure transfers data to 168 Excel named ranges.

However, there are 3 named ranges which result in Error
1004. Here is part of the code. ..

If Not IsNull(!PDRN) Then
M = !TheGroup: N = !PDRN:O = !CapRN
Else
GoTo HeyGo
End If
Set objXLSheet = objXLWb.Worksheets(M)
If N = "GGGTeam2" Then GoTo WasBad
If N = "PTwoATCT33343" Then GoTo WasBad
objXLSheet.Range(N).Clear: objXLSheet.Range(N) = !TotPts
===
The Error 1004 occurs in "objXLSheet.Range(N).Clear"
directly above. I used the 2 "If" statements to ensure the
rest of the code worked.
===
WasBad:
If O = "CWAGT23343" Then GoTo HeyGo
objXLSheet.Range(O).Clear: objXLSheet.Range(O) = !CapPts
===
The Error 1004 occurs in "objXLSheet.Range(N).Clear"
directly above. I used the 2 "If" statements to ensure the
rest of the code worked.
===
HeyGo:
.MoveNext

I don't know that much about Excel, but I suspect the
Worksheet holding the 3 "bad" cells could be a partially-
corrupted file. The 3 errors occur in adjacent rows in
the adjacent columns. The named ranges directly above &
below the "2 bad rows" work fine.

Thinking about making a new Worksheet for the part of the
automation. We are using 6 Worksheets to receive the
Access data. The VBA code is solid & works for the rest
of the named ranges.

Any ideas welcomed. I did insert 2 rows between the 2 bad
rows, but that didn't fix the problem.

TIA - Bob

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation to Excel from Access Bob Barnes Excel Discussion (Misc queries) 1 February 11th 08 05:18 AM
automation from access into excel SAm Excel Discussion (Misc queries) 7 January 27th 06 02:49 AM
Access automation from Excel AccessChallenged Excel Programming 2 December 31st 03 06:29 PM
Automation from .pdb to excel and then to access Kenny chan Excel Programming 1 December 13th 03 01:28 AM
Automation Excel & Access GarethG Excel Programming 6 October 3rd 03 09:14 AM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"