View Single Post
  #4 (permalink)  
Old 05-20-2009, 03:39 PM
jowilla442 jowilla442 is offline
Junior Member
 
About:
Join Date: May 2009
Posts: 5
jowilla442 is on a distinguished road

Default Replace invalid filename characters


Thanks for your reply William,

Either would be acceptable, I'm just not sure how to do it... (I'm not a very good programmer - I'm actually just an electrician who got roped into making this spreadsheet because I worked with computers in one of my past lives)...

Here's the macro I have so far. This is executed after the user fills out a form and clicks on a graphic:

Sub SaveFile()

Dim FName As String
Dim FPath As String

FPath = "C:\SCI_REPORTS"
FName = Sheets("SCI REPORT").Range("D3").Text
ThisWorkbook.SaveAs Filename:=FPath & "\" & FName

Call Shell("C:\SCI_REPORTS\UTILITIES\SCI_XFR_621.bat", vbNormalFocus)
Call Shell("C:\SCI_REPORTS\UTILITIES\ExcelExit.bat", vbNormalFocus)

End Sub


If I could tweak this to prompt the user or just replace the invalid characters (preferrably just replace the invalids). I'd be home free!

Thanks again!
-John



Reply With Quote