I have an Excel macro (VBA) in workbook ‘A’. It opens a text file into another Excel workbook (‘B’) so that it can copy the data into a worksheet in workbook ‘A’. The macro uses Workbooks.OpenText, which brings the textfile through the wizard. The routine works fine when I STEP (F8) through it; but when I RUN it, it just stops after opening the text file.
Help…?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Macro Open File Stops (9.0.4402 SR-1)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Macro Open File Stops (9.0.4402 SR-1)
- This topic has 7 replies, 3 voices, and was last updated 20 years, 1 month ago.
AuthorTopicWSrpwoods
AskWoody LoungerApril 1, 2005 at 10:34 pm #417845Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody Lounger -
WSrpwoods
AskWoody LoungerApril 1, 2005 at 10:41 pm #938566Sub GetNewData()
‘Import data from ‘CompLists.txt’ into new Excel file
Workbooks.OpenText Filename:=”C:TempCompList.txt”, Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _
Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), _
Array(10, 1), Array(11, 1))MsgBox “CompList.txt opened”, , “GetNewData”
This MsgBox doesn’t display when the macro is run, but it does if the macro is stepped through.
-
WSHansV
AskWoody LoungerApril 1, 2005 at 10:46 pm #938567See what happens if you add an error handler:
Sub GetNewData()
On Error GoTo ErrHandler‘Import data from ‘CompLists.txt’ into new Excel file
Workbooks.OpenText Filename:=”C:TempCompList.txt”, Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _
Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), _
Array(10, 1), Array(11, 1))MsgBox “CompList.txt opened”, , “GetNewData”
… ‘ other code goes hereExitHandler:
Exit SubErrHandler:
MsgBox Err.Description, vbExclamation
Resume ExitHandler
End Sub -
WSrpwoods
AskWoody Lounger -
WSHansV
AskWoody LoungerApril 1, 2005 at 11:14 pm #938571When I run the code with a text file that exists on my PC, the message box does get displayed. Could you attach a zip file with stripped down copies of the workbook and of the text file? Remove everything that is not relevant to this problem, and replace sensitive data with dummy data.
-
-
-
-
-
WSpieterse
AskWoody LoungerApril 2, 2005 at 8:04 am #938607This wouldn’t have something to do with this KB article?
http://support.microsoft.com/default.aspx?…kb;en-us;555263%5B/url%5D
-
WSrpwoods
AskWoody Lounger
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
1 hour, 58 minutes ago -
X Suspends Encrypted DMs
by
Alex5723
4 hours, 10 minutes ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
4 hours, 27 minutes ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
5 hours, 5 minutes ago -
OpenAI model sabotages shutdown code
by
Cybertooth
5 hours, 42 minutes ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 hour ago -
Enabling Secureboot
by
ITguy
51 minutes ago -
Windows hosting exposes additional bugs
by
Susan Bradley
13 hours, 36 minutes ago -
No more rounded corners??
by
CWBillow
9 hours, 24 minutes ago -
Android 15 and IPV6
by
Win7and10
1 hour, 17 minutes ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
1 day, 1 hour ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
1 day, 4 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
23 hours, 13 minutes ago -
Windows Update orchestration platform to update all software
by
Alex5723
1 day, 11 hours ago -
May preview updates
by
Susan Bradley
23 hours, 21 minutes ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
14 hours, 56 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
1 day, 4 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
1 day, 1 hour ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
3 hours, 25 minutes ago -
At last – installation of 24H2
by
Botswana12
2 days, 3 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
11 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
2 days, 15 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
14 hours, 8 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
3 days, 5 hours ago -
Another test post
by
gtd12345
3 days, 5 hours ago -
Connect to someone else computer
by
wadeer
2 days, 23 hours ago -
Limit on User names?
by
CWBillow
3 days, 2 hours ago -
Choose the right apps for traveling
by
Peter Deegan
2 days, 16 hours ago -
BitLocker rears its head
by
Susan Bradley
2 days ago -
Who are you? (2025 edition)
by
Will Fastie
1 day, 23 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.