LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Saving Files

My macro used to save the file to the directory that Excel was executed from.
Now my Macro only saves to the root of My Documents. No matter what
directory I am in the program thinks the CurDir in My Document

MySavePath = CurDir (This is the only reference to CurDir in the Module)

'Save Excel Workbook
ActiveWorkbook.Save

Sheets("AP4301").Select
AcctMth = Str(Month(Range("AcctgPeriod").Value))
AcctYear = Str(Year(Range("AcctgPeriod").Value))

'Save Import File in Text Format
ActiveWorkbook.SaveAs Filename:= _
MySavePath & "\AP4301OKCityJIBImport" & Trim(AcctMth) & Trim(AcctYear)
& ".txt", _
FileFormat:=xlTextWindows, CreateBackup:=False

I do not want to hard code the directory path in the file since the directory
changes. Were there update to CurDir function in the patches that Micro Soft
send out? Is there a way, to select a directory like when I use th e
FileDialog

With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Filters.Add "Text files", "*.den"

This is fustrating not knowing where the file will be save

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving files colleen Excel Discussion (Misc queries) 1 March 2nd 07 05:52 AM
Closing files and saving files dan Excel Worksheet Functions 0 August 15th 06 04:07 AM
Saving Files Jez[_7_] Excel Programming 3 April 4th 06 06:11 PM
saving files Marlis Excel Discussion (Misc queries) 0 August 17th 05 05:56 AM
Saving csv files Steve Excel Discussion (Misc queries) 2 July 20th 05 06:43 PM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"