Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
i am using the following code to open two txt files that open fine in notepad:
Workbooks.OpenText "C:\Orders\" & Range("B2"), Origin:= _ xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, _ 1), Array(10, 1), Array(40, 1), Array(58, 1), Array(68, 1)), TrailingMinusNumbers:=True this first code works fine to open the file and edit the document in excel 2007. the following code in a second macro gives an error message: "This file is not in a recognizable format...., if you know the file is from another program which is incompatible...., if you suspect the file is damaged,......, if you still want to see what text is contained ..... the code to open the second file is: Workbooks.OpenText Filename:="C:\Orders\" & Range("B4"), Origin:= _ xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, _ 1), Array(10, 1), Array(18, 1), Array(30, 1), Array(60, 1), Array(66, 1)), TrailingMinusNumbers:=True what's wrong with the second code? jat |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening Excel, Book1 opens, remains open with other workbook open | Excel Discussion (Misc queries) | |||
how do i open a data workbook when i open a timesheet workbook | Excel Discussion (Misc queries) | |||
excel 2003 saved file will not open without a blank workbook open | Excel Discussion (Misc queries) | |||
Search open sheets in workbook and insert into open sheet | Excel Discussion (Misc queries) | |||
Excel workbook does not open in open window on desktop | Excel Discussion (Misc queries) |