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: 41
Default .txt import + saveas + mkdir

Hey everyone!

I have written a macro to import and manipluate a deliminated text file. It
works well, until I try to have the macro save as! The text files are named
by a program and they have trailing spaces at the end. Example: "EAST 7-621
- G1 .txt" I would like to do a few things that I can't figure out,
and I'm hoping for some assistance:

1. Remove those trailing spaces without removing the inner spaces. Would it
work to Trim(Replace(FileName,".txt",""))?

2. I want the macro to check if a certain directory in this case
"s:/PlanSwift Exports/Jobs/" & strInput is present. If it is, it will create
a new directory inside of that "/WallsPlus" where it will save the file. If
the directory is not present, it will create the strInput directory, then
create the /WallsPlus directory, then save the files within that. *** I
understand how to create the directories if they are not present, but I don't
know how do to it conditionally so that it doesn't overwrite, or give a Path
Not Found error!

3. Save As file. When I try to do a simple ActiveWorkbook.SaveAs I get
errors saying I can't save as that file type. I think it's because it's
currently a .txt file, but i'm not sure how to save a .txt as a .xlsx

I hope these questions are clear, and not asking too much! Hope someone can
give me some help, as I'm getting really frustrated not being able to figure
this seemingly simple stuff out!

 
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
MkDir question Jim G Excel Programming 6 December 4th 08 07:58 PM
mkdir Peter[_61_] Excel Programming 2 May 12th 07 12:48 PM
MKDir not working Robert_L_Ross Excel Programming 3 June 30th 06 07:17 AM
MkDir and Save As wtpcomplab Excel Programming 2 December 9th 04 09:09 PM
MkDir error Eric Excel Programming 3 May 17th 04 08:58 PM


All times are GMT +1. The time now is 02:29 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"