![]() |
text import inhibit required
As a relative newbie to macros I'd sure appreciate some help. 'I'
generated the macro using the macro recorder facility which recorded my use of the data/text import wizard. Works great! Only problem is that as soon as I open the template it immediatly asks me what text file I want to import. I'd like the template/worksheet to only initiate text import when I tell it to via a button or shortcut or whatever NOT immediately on opening. So, firstly I'd be very grateful for the answer and secondly could anyone recommend a good book that could provide me with such answers so that I don't have to waste your time on what is probably a trivial question (for you anyways). many thx in advance Danny |
text import inhibit required
I wonder if you somehow placed the code in a module entitled ThisWorkbook,
inside the Workbook_Open event. If so, that's not where it belongs. MOve it to a Sub in a standard module (you'll have to insert the latter). On 1 Oct 2005 16:37:06 -0700, wrote: As a relative newbie to macros I'd sure appreciate some help. 'I' generated the macro using the macro recorder facility which recorded my use of the data/text import wizard. Works great! Only problem is that as soon as I open the template it immediatly asks me what text file I want to import. I'd like the template/worksheet to only initiate text import when I tell it to via a button or shortcut or whatever NOT immediately on opening. So, firstly I'd be very grateful for the answer and secondly could anyone recommend a good book that could provide me with such answers so that I don't have to waste your time on what is probably a trivial question (for you anyways). many thx in advance Danny |
text import inhibit required
er...right.....hmmmm. thx for the reply. this is the macro:
Sub Macro1() ' ' Macro1 Macro ' Macro recorded 1/10/2005 by Daniel ' ' With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:\Documents and Settings\Daniel\My Documents\test.txt", Destination:= _ Range("A2")) .Name = "test" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = xlWindows .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierNone .TextFileConsecutiveDelimiter = True .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = True .TextFileSpaceDelimiter = True .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1) .Refresh BackgroundQuery:=False End With Application.CommandBars("External Data").Visible = False End Sub many thx Danny |
All times are GMT +1. The time now is 10:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com