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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

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,175,846
Messages
5,899,809
Members
434,799
Latest member
Mussala

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