Hello,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I need help with this code below. The code is extracting 4 last strings of the name of the file that is being uploaded and names it to new just added worksheet. The code doesn’t work and Excel debugs it as “Compile error:Expected array” in the "Find"
<o> </o>
Dim FileName2 As String<o></o>
Dim Filename1 As String<o></o>
Dim Filename As String<o></o>
Dim FLName As String<o></o>
FLName = Application.GetOpenFilename<o></o>
Dim NewSheet As Worksheet<o></o>
Filename1 = Right(FLName, 12)<o></o>
FileName2 = Mid(Filename1, Find(".", Filename1) + 1, 4)<o></o>
Worksheets.Add().Name = FileName2<o></o>
Set NewSheet = ActiveSheet
<o> </o>
<o> </o>
I am not sure what it is about .The code seems correct.
<o> </o>
Any suggestions will be greatly appreciated
<o> </o>
The Best Regards,
<o> </o>
BorisGomel
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I need help with this code below. The code is extracting 4 last strings of the name of the file that is being uploaded and names it to new just added worksheet. The code doesn’t work and Excel debugs it as “Compile error:Expected array” in the "Find"
<o> </o>
Dim FileName2 As String<o></o>
Dim Filename1 As String<o></o>
Dim Filename As String<o></o>
Dim FLName As String<o></o>
FLName = Application.GetOpenFilename<o></o>
Dim NewSheet As Worksheet<o></o>
Filename1 = Right(FLName, 12)<o></o>
FileName2 = Mid(Filename1, Find(".", Filename1) + 1, 4)<o></o>
Worksheets.Add().Name = FileName2<o></o>
Set NewSheet = ActiveSheet
<o> </o>
<o> </o>
I am not sure what it is about .The code seems correct.
<o> </o>
Any suggestions will be greatly appreciated
<o> </o>
The Best Regards,
<o> </o>
BorisGomel