More specifically, why am I getting a space between strarray(1) and strarray(2) in newFilename? Thanks in advance!
Sub Button1_Click()
Dim orgFilename As String
Dim temp As String
Dim strarray(3) As String
Dim newFilename As String
orgFilename = Application.GetOpenFilename(FileFilter:="All files (*.), *.", Title:="Please select a file")
temp = Mid$(orgFilename, InStrRev(orgFilename, "\") + 1)
strarray(1) = Left(orgFilename, InStrRev(orgFilename, "\"))
strarray(2) = "processed_"
strarray(3) = temp
newFilename = Join(strarray)
End Sub
Join adds spaces by default.
Check out the first paragraph in this link:
http://msdn.microsoft.com/en-us/library/aa164507%28v=office.10%29.aspx
instead use