-
Related code
Here's some code that addresses the differences between Mac and PC path names:
[VBA]Sub GetNewFileName(File_name$, sName)
Select Case MacOrPC("")
Case "Mac"
sel = ":"
ff = "XSL8"
Case "PC"
sel = "\"
ff = "Excel (*.xls),*.xls"
End Select
File_name$ = Application.GetSaveAsFilename(Initialfilename:="New file", FileFilter:=ff)
kout = 1
sName = File_name$
Do 'Get file short name
kn = InStr(sName, sel)
If kn <> 0 Then
sName = Mid$(sName, kn + 1, Len(sName))
Else
Exit Do
End If
Loop
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function MacOrPC(Path) As String
If Path = "" Then Path = CurDir()
' ' debug.Print Path
MacOrPC = "Mac"
nx = Len(Path)
For i = 1 To nx - 1
If Mid$(Path, i, 2) = ":\" Then MacOrPC = "PC"
Next i
End Function[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules