File Re-open

taha54

Board Regular
Joined
Aug 11, 2006
Messages
103
hi all, i have a file lets call temp.xls , i used a VBA cde to do an operation on that file and save it in the same directory as a unicode txt file,

Code:
sub code()
operations

fname = ActiveWorkbook.Name

If Mid(fname, Len(fname) - 3, 1) = "." Then fname = Left(fname, Len(fname) - 4)
locat = "C:\Documents and Settings\Administrator\Desktop\E2A\" & fname & ".txt"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=locat, FileFormat:=xlUnicodeText
Application.DisplayAlerts = True
ActiveWorkbook.Close (False)

how can i re open my excel file whih is in the same directory to perform one more step in VBA on that txt file

thank you

EDIT: Added Code tags - Smitty
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
If you had:

fFullName = ActiveWorkbook.FullName

you could open it again with:

Workbooks.Open fFullName
 

Watch MrExcel Video

Forum statistics

Threads
1,111,910
Messages
5,541,538
Members
410,547
Latest member
htran4
Top