Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Defined or Object Defined Error

Status
Not open for further replies.

EliseFreedman

Programmer
Dec 6, 2002
470
GB
Hi There

I hope someone can help me with this problem before I completely loose all my hair.

I have a spreadsheet set up to collate statistics. The spreadsheet summarises statistics from a variety of feeder worksheets. This has been working fine for months but suddenly has stopped working and Ive no idea why. The only change I can think of is that some extra rows were added to the worksheet. I dont think the issue lies here though as we tried going back to an older version of the worksheet and still got the same error.

I am getting an application defined or object defined error. It occurs on the last line. Can anyone shed any light on what could be causing this.

Elise

Code:
Sub JulyAttended()
'
' OctoberStats Macro
' Macro recorded 26/10/2007 by Elise.Freedman
'
  Sheets("July Attended").Select
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:="TEXT;M:\depts\HS&ES\Medical\KAY STATS\Attended.txt", Destination _
        :=Range("A1"))
        .Name = "Attended_5"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 850
        .TextFileStartRow = 2
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = True
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=True
 


Hi,

Does this file exist in this path?
[tt]
M:\depts\HS&ES\Medical\KAY STATS\Attended.txt
[/tt]
Has the file structure changed? You have 7 GENERAL fields defined.

You do realize that you have both TAB and COMMA designated as delimiters?

I assume that when you execute the query, there is NOTHING on sheet July Attended.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top