#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Error

Sorry one more item; this is the error I receive:
Runtime error '-2147417848 (80010108)':
Method'_Default' of object 'Range'failed

"Simon Lloyd" wrote:


Jen_T where does the code fall down and what is the error number?, can
you explain a little of what you are trying to achieve with this code?,
i do notice that not all your variables have been declared, there may be
a problem there.

Jen_T;295683 Wrote:
Sorry about that meant to do that.. Thank you

Here the portion of the code I receive the error

Code:
--------------------

Private Sub writeToClean(i As Long, settings As clsSettings, rawData As
clsRawData)

'Find ith row in raw. Do it by calling a function in rawData that
returns a range
Dim clnWrkSht As Worksheet
Set clnWrkSht =
settings.getSettingsWrkBk.Worksheets(settings.getC leanWrkSht)

Dim headerRange As Range, ithRange As Range
Set headerRange = rawData.get_ith_row(0)
Set ithRange = rawData.get_ith_row(i)

Dim varHeaderRange As Variant, numHeaderRange As Long
varHeaderRange = WorksheetFunction.Transpose(headerRange)
numHeaderRange = WorksheetFunction.CountA(varHeaderRange)

Dim cols As Variant, extract, multiVal, freeFormAllowed
Dim possibleVal As Range
cols = WorksheetFunction.Transpose(settings.getColumn)
extract = WorksheetFunction.Transpose(settings.getExtract)
multiVal = WorksheetFunction.Transpose(settings.getMultipleVa lue)
freeFormAllowed = WorksheetFunction.Transpose(settings.getFreeFormAl lowed)
Set possibleVal = settings.getPossibleValues

Dim clnHeadings As Variant
clnHeadings = settings.getHeadings

Dim k As Long, j As Long, clnHeadingCntr As Long, a As Long, b As Long,
c As Long
Dim PosValAt_i As Range, PosValAt_i_Array As Variant
clnHeadingCntr = LBound(clnHeadings)

For k = LBound(varHeaderRange) To (LBound(varHeaderRange) +
numHeaderRange - 1)
If cols(k) = varHeaderRange(k, 1) Then
If (extract(k) = "Y") Then
If (multiVal(k) = "N") Then
clnHeadingCntr = clnHeadingCntr + 1
clnWrkSht.Cells(i + 1, clnHeadingCntr) =
ithRange.Cells(1, k)
Else
Set PosValAt_i = possibleVal.Rows(k)
b = WorksheetFunction.CountA(PosValAt_i)
PosValAt_i_Array = Range(possibleVal.Cells(k, 1),
possibleVal.Cells(k, b))
For a = 1 To rawData.getNumOfRowsAt_i(i)
If (Not IsEmpty(ithRange.Cells(a, k))) And
ithRange.Cells(a, k) < "" Then
c = -1
On Error Resume Next
c =
WorksheetFunction.Match(Trim(ithRange.Cells(a, k)), PosValAt_i_Array, False)
On Error GoTo 0
If c = -1 Then
If freeFormAllowed(k) = "N" Then
MsgBox "Something is wrong"
Stop

--------------------



"Chip Pearson" wrote:


Post the code that is causing the problem.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
'www.cpearson.com' (http://www.cpearson.com)
(email on web site)

On Fri, 3 Apr 2009 07:39:01 -0700, Jen_T
wrote:

I was wondering if anyone knows what this error means when I run a

macro i
get this error:
Method 'Default' of object 'Range' failed



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=82532


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
Error when cell A1 is not active and xlInsideVertical border formatthrowing error 1004 [email protected] Excel Programming 7 August 7th 08 08:43 PM
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 02:25 PM.

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"