Query Refresh

J

JohnJack

Hello All,

I have had to modify a spreadsheet written by a ex-coworker and here
is my problem.
When I open up the workbook, it asks if I want to enable or disable
automatic refresh. For the style of spreadsheets my company uses, I
would like this option to NEVER come up and for the automatic refresh
to be disabled. I have tried clearing on the query tables, saving,
closing and reopening and it still asked me to refresh or not. I have
tried different settings in the options menu in excel and still
nothing.

Here is a copy of my general import code. The same code is used to
import numerous files. Is there something here I could change? Or is
there something I'm completely missing?

'import *.tab file
SourceFile = "TEXT;" & LoadsResultsPath & ResultsRootName & ".tab"
Dest = 1 + 14 * counter

Sheets(TabInputPage).Select
With ActiveSheet.QueryTables.Add(Connection:=SourceFile,
Destination:=Cells(2, Dest))
.Name = ".tab"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = True
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = False
.AdjustColumnWidth = False
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With


Thanks for any help you may be able to give me. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top