Hello,
I am populating a spread sheet, via VS2010, which is stored on a shared drive.
Then it automatically create a separate folder with the name of that file, e.g. file "A.23.04.2018"
The problem comes when I try to copy the workbook from the shared drive onto its dedicated folder.
It doesn't even throw an error, just creates the folder which is always empty.
Any help would be appreciated.Code:Private Sub CreateFolder() Dim xlSheet As Object = CType(xlApp.Worksheets("Form"), Excel.Worksheet) Dim YourPath As String = IO.Path.Combine("\\frtstpr-dna203a\tou5\Example_Design\11_SSBD\01_SSBD_Lcl_ad_open\Improvements\" + xlSheet.cells(6, 2).value.ToString + xlSheet.cells(6, 3).value.ToString + xlSheet.cells(6, 4).value.ToString) Try If (Not System.IO.Directory.Exists(YourPath)) Then System.IO.Directory.CreateDirectory(YourPath) End If My.Computer.FileSystem.CopyFile( _ "\\frtstpr-dna203a\tou5\Example_Design\01_SSBD\01_SSBD_Lcl_ad_open\Improvements\TR tracker\TR_Template_Draft_01.xlsm", _ YourPath & ".xlsm", overwrite:=False) Catch ex As Exception MsgBox(ex.Message) End Try End Sub




Reply With Quote
