Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't browze and open file, urgent!
Hi all!
I've a quick question with respect to the short macro shown below. Sub importfile() Application.DisplayAlerts = False MyFile = Application.GetOpenFilename("text files,*.txt") Workbooks.OpenText FileName:=MyFile, _ Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _ Array(Array(0, 1), Array(11, 1), Array(20, 1)) ActiveWindow.WindowState = xlNormal Sheets("MyFinal").Select Sheets("MyFinal").Move Befo=Workbooks ("vtec.xls").Sheets(1) End Sub The browsed and selected *.txt file is assigned to the variabl "MyFile". However, I am unable to move it before the existing workbook ' tec.xls' and it is giving me error. A small error in the line: Sheets("MyFinal").Select Sheets("MyFinal").Move Befo=Workbooks("vtec.xls").Sheets(1) I would appreciate any tips. Thanks alot guys. Regds, Arun. Vtec Corp -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't browze and open file, urgent!
See answer to 3rd posting of this question.
-- Regards, Tom Ogilvy "aiyer " wrote in message ... Hi all! I've a quick question with respect to the short macro shown below. Sub importfile() Application.DisplayAlerts = False MyFile = Application.GetOpenFilename("text files,*.txt") Workbooks.OpenText FileName:=MyFile, _ Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _ Array(Array(0, 1), Array(11, 1), Array(20, 1)) ActiveWindow.WindowState = xlNormal Sheets("MyFinal").Select Sheets("MyFinal").Move Befo=Workbooks ("vtec.xls").Sheets(1) End Sub The browsed and selected *.txt file is assigned to the variable "MyFile". However, I am unable to move it before the existing workbook 'V tec.xls' and it is giving me error. A small error in the line: Sheets("MyFinal").Select Sheets("MyFinal").Move Befo=Workbooks("vtec.xls").Sheets(1) I would appreciate any tips. Thanks alot guys. Regds, Arun. Vtec Corp. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Urgent: Free/Open Source alternative to MapPoint? | Charts and Charting in Excel | |||
Excel - Corrupt File / Urgent | Excel Discussion (Misc queries) | |||
In Excel - Use Windows Explorer instead of File Open to open file | Excel Discussion (Misc queries) | |||
URGENT!!!BIg FILE SIZE??? | Excel Discussion (Misc queries) | |||
Urgent info. on opening a mail merge with the datasource open | Excel Programming |