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
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

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
 

Forum statistics

Threads
1,141,155
Messages
5,704,618
Members
421,360
Latest member
Rhodia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top