Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 111
Default Debug Error

Below is a copy of a macro which runs fine with Windows XP, but when I
try to run it with Vista I get a debug error at the bottom of the
Destination:=Range _ which states:

..Refresh BackgroundQuery:=False

I have tried changing it to False, but I still get errors.

Any ideas what the problem might be?


Sub Horsedata()
'
' Horsedata Macro
'
' Keyboard Shortcut: Ctrl+z
'
Sheets("Horsecopy").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Documents and Settings\user\Desktop\hdata.txt",
Destination:=Range _
("$A$1"))
.Name = "hdata"
.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 = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("A1:H1501").Select
Selection.Copy
Sheets("Horselist").Select
Range("B2").Select
ActiveSheet.Paste
Sheets("Horsecopy").Select
Cells.Select
Application.CutCopyMode = False
Selection.QueryTable.Delete
Selection.ClearContents
Sheets("Horselist").Select
Range("K29:M30").Select
Selection.ClearContents
Range("A1").Select
End Sub
 
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
Macro Debug Error Soroya1920 Excel Discussion (Misc queries) 1 June 26th 07 09:53 PM
Debug Error in Code Karen McKenzie Excel Discussion (Misc queries) 2 May 18th 07 04:25 PM
DeBug Ollie Excel Discussion (Misc queries) 4 April 28th 06 03:17 PM
How do I resolve debug error macro Excel 2000? At least, any lead Excel 2000 Macros debugger Excel Discussion (Misc queries) 5 October 25th 05 08:56 AM
help with debug Rusty New Users to Excel 3 February 2nd 05 03:16 AM


All times are GMT +1. The time now is 10:07 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"