J
Jaymac
Hi folks
I am trying to save the same file to two separate drives via a macro. I
have cobbled together the following code from the VBA help files but it will
only save to the first drive. The pathname is the same on both drives with
the exception of tghe drive letter.
Set fd = Application.FileDialog(msoFileDialogSaveAs)
Dim vrtSelectedItem, vrtsave As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
vrtsave = "I" & Mid(vrtSelectedItem, 2, Len(vrtSelectedItem) - 1)
Next vrtSelectedItem
Else
End If
If .Show = -1 Then
Select Case .DialogType
Case msoFileDialogSaveAs: .Execute
Case Else
End Select
Else
End If
vrtSelectedItem = vrtsave
MsgBox "The path is: " & vrtSelectedItem
Select Case .DialogType
Case msoFileDialogSaveAs: .Execute
Case Else
End Select
End With
End Sub
I would appreciate any help I can get
Many thanks
Jack
I am trying to save the same file to two separate drives via a macro. I
have cobbled together the following code from the VBA help files but it will
only save to the first drive. The pathname is the same on both drives with
the exception of tghe drive letter.
Set fd = Application.FileDialog(msoFileDialogSaveAs)
Dim vrtSelectedItem, vrtsave As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
vrtsave = "I" & Mid(vrtSelectedItem, 2, Len(vrtSelectedItem) - 1)
Next vrtSelectedItem
Else
End If
If .Show = -1 Then
Select Case .DialogType
Case msoFileDialogSaveAs: .Execute
Case Else
End Select
Else
End If
vrtSelectedItem = vrtsave
MsgBox "The path is: " & vrtSelectedItem
Select Case .DialogType
Case msoFileDialogSaveAs: .Execute
Case Else
End Select
End With
End Sub
I would appreciate any help I can get
Many thanks
Jack