|
-
Mar 8th, 2010, 10:43 AM
#1
Thread Starter
New Member
[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
-
Mar 8th, 2010, 10:47 AM
#2
Re: Common Dialog Problem
You could store the selected path to a variable and after the measurement process, store the data to that location...
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Mar 8th, 2010, 11:12 AM
#3
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.
-
Mar 8th, 2010, 03:29 PM
#4
Re: Common Dialog Problem
what path do you want to save the data to?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 9th, 2010, 05:41 AM
#5
Thread Starter
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|