Hi there.
I have the following code that we are using to save a file to a pre-determined network address.
However since migrating to the latest version of excel the below code does not work with the new version of VBA7, also 64 bit and 32 bit Excel versions is proving a bit of an issue.
Think I might also have some issues with mapping of network drives, as this will be used by several end users to save their outputs I cannot guarantee that they will all have mapped the network folder to the same drive.
Can anyone please help me complete this task and allow our users to save the outputs in the desired area.
Many thanks in advance for your help
Sub Submit()
Dim vFileToOpen As Variant
Dim strCurDir As String
Dim VFilename As Variant
' Keep Original Dir
strCurDir = CurDir
VFilename = Worksheets("input").Range("D8") & " WLM " & Worksheets("input").Range("D12") & ".xlsx"
' Note: If the UNC path does not exist then it will default to your current one
SetCurrentDirectory "\\staffshare.ads.ecu.edu.au\FBL\Projects\Workload Models"
' Saves file
Application.EnableEvents = False
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:=VFilename, FileFormat:=51, CreateBackup:=False
Application.DisplayAlerts = True
Application.EnableEvents = True
' Change directory back
ChDir strCurDir
ThisWorkbook.Close
End Sub
I have the following code that we are using to save a file to a pre-determined network address.
However since migrating to the latest version of excel the below code does not work with the new version of VBA7, also 64 bit and 32 bit Excel versions is proving a bit of an issue.
Think I might also have some issues with mapping of network drives, as this will be used by several end users to save their outputs I cannot guarantee that they will all have mapped the network folder to the same drive.
Can anyone please help me complete this task and allow our users to save the outputs in the desired area.
Many thanks in advance for your help
Sub Submit()
Dim vFileToOpen As Variant
Dim strCurDir As String
Dim VFilename As Variant
' Keep Original Dir
strCurDir = CurDir
VFilename = Worksheets("input").Range("D8") & " WLM " & Worksheets("input").Range("D12") & ".xlsx"
' Note: If the UNC path does not exist then it will default to your current one
SetCurrentDirectory "\\staffshare.ads.ecu.edu.au\FBL\Projects\Workload Models"
' Saves file
Application.EnableEvents = False
Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:=VFilename, FileFormat:=51, CreateBackup:=False
Application.DisplayAlerts = True
Application.EnableEvents = True
' Change directory back
ChDir strCurDir
ThisWorkbook.Close
End Sub