Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default The directory property cannot be found in the cache 8000500d

I get this error when access the record attributes of the oObj. The crash
happens when the oObj.Get(Attributes(LoopCounter)) tries to pull data from an
attribute that has no value or a null, I am guessing. The database being
addressed used ADO to connect to and search an LDAP database. I have tried a
number of error handling techniques available to VBA for Excel but no good.
Still throws an exception that I cannot seem to trap so that I can reset and
just carry on to the next attribute. I am not new to development but fairly
new to VB and VBA specifically. The number of rows of data I am pulling with
this function ends up at 850 rows with about 30 attributes. This crashes on
any attribute with a null value.

Any ideas would be greatly appreciated. I am still surfing the web looking
to see if others have already discovered the answer. MSDN wasn't much help
as yet either.

Function PopulateRow(ByVal rsObj As Object, ByRef Attributes() As String,
ByVal _ RowNumber As Integer, ByVal columnNumber As Integer)

Dim LoopCounter As Integer
On Error Resume Next

' Populate a row of the spreadsheet with the Attributes from the
Metadirectory
Set CurrentCell = Cells(RowNumber, columnNumber)

LoopCounter = 0

' Go through the list of Attributes and add the Metadirectory value to
the spreadsheet
While (Len(Attributes(LoopCounter)) 0)
Set Value = Nothing

Value = rsObj.Get(Attributes(LoopCounter))

' Put the value in the spreadsheet cell
CurrentCell.Value = Value

' Get the next attribute
LoopCounter = LoopCounter + 1

' Move over to the next cell (column)
Set CurrentCell = CurrentCell.Offset(0, 1)

Wend

End Function



Thanks,

Bryan44
Reply
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
Run-Time Error (8000500d) - The directory property cannot be found Bryan44 Excel Programming 1 January 31st 08 03:06 AM
Change current directory to the directory that the workbook loads from! alondon Excel Programming 5 April 17th 07 06:05 AM
Setting CommandText property of PivotCache fails if cache has 1 PivotTable ashortxl Excel Programming 1 May 20th 05 10:27 PM
Creating a macro that lists directory names within a directory.... Andy Excel Programming 4 November 28th 04 06:13 AM
Check if directory empty OR no of files in directory. Michael Beckinsale Excel Programming 2 December 4th 03 10:12 PM


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

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

About Us

"It's about Microsoft Excel"