Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Excel's text import wizard by code?
I have a problem with opening text files with Excel. My text file
consists of tab separated columns. Some "columns" have regular text,
some math calculations and some numbers with a + sign in front of them.
Now the regular strings and the calculations are opened and displayed just fine, but the ones starting with a + sign don't. And therefore those columns cannot be read -> I get a read error when trying to do so.
Now, I have determined that when I open the .txt file manually from
Excel.. the 'text import wizard' section where you get to select the
format for each of the to be created columns (i think its the wizard's page 3) is the one that matters, because when I select the format to
be text for those columns that start with a + sign it works fine and
displays the data correctly (that is with the actual + sign).
However, if you first open the .txt file into Excel and try to manually
alter the format of the columns (using the "Format cells" option) it
doesn't work either.. Why?
It seems that the only way of opening the .txt file correctly is by
using the 'text import wizard' and IT'S column format option..?
How can i do this through my code? The regular xlDelimited parameters
doesn't seem to do the trick..
0 · ·