poorwallace
Active Member
- Joined
- Mar 8, 2005
- Messages
- 365
I have some code that's supposed to save the currently open Excel file as a .txt file and then reopen it (the macro runs from a different Excel file). The problem is that the code looks in a completely different folder from my desktop (where the file is not located at). Is there a way to make the shell function look in a specific spot?
Thanks in advance; right now I'm not seeing why this isn't working (as it has worked in the past)....here is the code
Thanks in advance; right now I'm not seeing why this isn't working (as it has worked in the past)....here is the code
Code:
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\wally\My Documents\BB_Upload.txt", FileFormat:= _
xlText, CreateBackup:=False
ActiveWorkbook.Save
ActiveWindow.Close
Application.DisplayAlerts = True
Windows("Part2a.xls").Activate
Sheets("Sheet1").Activate
Windows(x).Activate
Dim Q As String
Q = Range("B2")
Sheets.Add.Name = Q & " Returns Sheet"
'Shell "notepad.exe C:\Documents and Settings\wally\My Documents\BB_Upload.txt"
Shell "C:\Program Files\Windows NT\Accessories\WORDPAD.EXE BB_Upload.txt"
Application.ScreenUpdating = True