I am using a barcode software that a company gave some visual basic code to auto-generate a serial number via a file it reference. I have the code listed below but I want to be able to change the path of where the file is located. I am not familiar enough with visual basic to do this so I need some help. The code is below:
'Called whenever this sub string needs to be displayed on the screen.
name = "SN"
Set objFSO = CreateObject("Scripting.FilesystemObject")
If NOT objFSO.FileExists(Format.Directory & "\" & name & ".txt") Then
Set objFile = objFSO.CreateTextFile(Format.Directory & "\" & name & ".txt")
set objFile = Nothing
Set objFile = objFSO.OpenTextFile(Format.Directory & "\" & name & ".txt")