Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to use Opentext method with xlFixedWidth?

Hi, everybody,

I want to import a text file into excel file, and I can use opentex
method. But the problem is that I want to convert each column in tex
file into one column in excel file. So I can use xlFixedWidt
parameter. But I do not know to fix the width ( I hope the width is on
character, the minimum). If I write code like these:

Workbooks.opentext Filename:=DaSourceBefore & DaSourceFile, _
Origin:=xlWindows, _
StartRow:=1, _
DataType:=xlFixedWidth, _

Width :=1

TextQualifier:=xlTextQualifierSingleQuote


It can not work. Please help me. Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to use Opentext method with xlFixedWidth?

Can you not set the macro recorder and then open the file to get th
code

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default How to use Opentext method with xlFixedWidth?

Do the import manually with the macro recorder turned on. That way you can
see and adjust graphically how Excel is splitting the text file into
columns. Then recover and edit the code in the vb editor.

HTH,
Shockley


"Together " wrote in message
...
Hi, everybody,

I want to import a text file into excel file, and I can use opentext
method. But the problem is that I want to convert each column in text
file into one column in excel file. So I can use xlFixedWidth
parameter. But I do not know to fix the width ( I hope the width is one
character, the minimum). If I write code like these:

Workbooks.opentext Filename:=DaSourceBefore & DaSourceFile, _
Origin:=xlWindows, _
StartRow:=1, _
DataType:=xlFixedWidth, _

Width :=1

TextQualifier:=xlTextQualifierSingleQuote


It can not work. Please help me. Thanks.


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass string as Parameter in OpenText method No Name Excel Programming 0 January 8th 04 06:22 AM
Can we Pass String to FieldInfo Array to OpenText Method. Niraj Kumar Singh Excel Programming 0 January 8th 04 05:35 AM
After OpenText all pastes from external apps use format from OpenText Jim[_31_] Excel Programming 1 November 8th 03 02:17 AM
Workbooks.OpenText Alistair Eberst Excel Programming 2 October 21st 03 12:50 PM
OpenText bug ? Orlando Magalhães Filho Excel Programming 0 August 1st 03 04:14 AM


All times are GMT +1. The time now is 05:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"