How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Ingo U Your Own Question
Ingo U
Ingo U, Software Engineer
Category: Programming
Satisfied Customers: 755
Experience:  Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
44076068
Type Your Programming Question Here...
Ingo U is online now
A new question is answered every 9 seconds

This code wipes out first row before executing rest of

Customer Question

This code wipes out first row before executing rest of Macro.
Workbooks.OpenText Filename:="H:\RCIC5121.TXT", Origin:=437 _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(1, 1), _
Array(10, 1), Array(17, 1), Array(24, 1), Array(32, 1), Array(43, 1), Array(54, 1), _
Array(65, 1), Array(76, 1), Array(88, 1), Array(97, 1)), TrailingMinusNumbers:=True 'GoTo SkipFG
How can I correct to leave the headers in first row
Submitted: 1 year ago.
Category: Programming
Expert:  Ingo U replied 1 year ago.

Hi

can you upload the excel file with the macro as well as the text file you're opening with it?

Thx,

Ingo U

Customer: replied 1 year ago.
The macro that fails is located in this tab that I extracted from a larger file.Row 1 Columns b through N is deleted when stepping through the Macro this occurs at this step
Workbooks.OpenText Filename:="H:\RCIC5121.TXT", Origin:=437 _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(1, 1), _
Array(10, 1), Array(17, 1), Array(24, 1), Array(32, 1), Array(43, 1), Array(54, 1), _
Array(65, 1), Array(76, 1), Array(88, 1), Array(97, 1)), TrailingMinusNumbers:=True 'GoTo SkipFG
The rest of macro executes properly but leaves Row 1 columns B through N blank
Expert:  Ingo U replied 1 year ago.

I don't follow... and can't reproduce what you're describing. That macro line just opens up the given file in a separate document window, doesn't touch anything else.

Can't you upload he entire thing you're dealing with? Including the entire macro(s) ?