Results 1 to 8 of 8

Invalid procedure call or argument

Threaded View

krish T Invalid procedure call or... 10-30-2010, 03:30 AM
JBeaucaire Re: Invalid procedure call or... 10-30-2010, 04:32 AM
JBeaucaire Re: Invalid procedure call or... 10-30-2010, 04:37 AM
krish T Re: Invalid procedure call or... 10-30-2010, 09:13 AM
krish T Re: Invalid procedure call or... 10-30-2010, 09:14 AM
JBeaucaire Re: Invalid procedure call or... 10-30-2010, 11:15 AM
krish T Re: Invalid procedure call or... 10-31-2010, 03:19 AM
JBeaucaire Re: Invalid procedure call or... 10-31-2010, 10:01 AM
  1. #1
    Forum Contributor
    Join Date
    10-01-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    125

    Invalid procedure call or argument

    I am getting the above error in the below code.

    Sub Read_Val()
    
    Dim req_val(1 To 50) As String
    Dim fName As String
    Dim fPath As String
    Dim FPtt As String
    Dim wsRaw As Worksheet
    Dim wsTxt As Worksheet
    Dim numRNG As Range
    
    FPtt = Range("A12").Value
    fPath = "" & CStr(FPt) & "\"
    
    fName = "" & CStr(FPt) & "\req_val.txt"
    
    Windows("cst.xls").Activate
    
    Set wsRaw = Sheets("Sheet1")
    
    Set numRNG = wsRaw.Range("A:A").SpecialCells(xlConstants, xlNumbers)
    
        Set wsTxt = Sheets.Add(After:=Sheets(Sheets.Count))
    
        With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & fName, Destination:=wsTxt.Range("A1"))
            .Name = "req_val"
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .TextFilePromptOnRefresh = False
            
    ' Getting problem in the below line as Invalid procedure call or argument
    
            .TextFilePlatform = 437
            .TextFileStartRow = 1
            .TextFileParseType = xlDelimited
            .TextFileTextQualifier = xlTextQualifierDoubleQuote
            .TextFileConsecutiveDelimiter = True
            .TextFileTabDelimiter = True
            .TextFileSemicolonDelimiter = False
            .TextFileCommaDelimiter = False
            .TextFileSpaceDelimiter = True
            .TextFileColumnDataTypes = Array(1)
            
     ' Getting the error if I comment the above error line: Object doesn't support this property or method
     
            .TextFileTrailingMinusNumbers = True
            .Refresh BackgroundQuery:=False
        End With
        
    End Sub
    Any correction required in the above code?
    Last edited by krish T; 10-31-2010 at 08:48 AM. Reason: code

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1