[RESOLVED] Common Dialog Problem
Hello!
So far i save data by running a measurement, and afterwards open common dialog an save the data under a path.
What I would like to do, is to define the path where data shall be stored before running the measurement and save the data under the predefined path.
I tried a bit around but found no solution. Can anyone help me?
Thanks
Philip
Re: Common Dialog Problem
You could store the selected path to a variable and after the measurement process, store the data to that location...:wave:
Re: Common Dialog Problem
You could also store the path in a database table field. In that way, you can easily change it if need be without having to recode or recompile.
Re: Common Dialog Problem
what path do you want to save the data to?
Re: Common Dialog Problem
thx for the replies, I found a solution. I did like this:
Code:
Dim fs
Dim f
With CDFilepath 'open a with statement as there is a lot of code
.DialogTitle = "" 'sets the dialog title
.Flags = cdlOFNPathMustExist + cdlOFNNoChangeDir
.filename = ""
.InitDir = "C:\" 'sets the initial directory
.Filter = "ASCII files (*.txt;*.log)*.txt;*.log" 'sets the file types
.ShowSave
sFileText = .filename
End With
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile(sFileText, True)
iFileNo = FreeFile available for use by the FileOpen function.
Open sFileText For Append As #iFileNo
Print #iFileNo,
Close #iFileNo