PC Review


Reply
Thread Tools Rate Thread

Display the Browse for Folder Dialog

 
 
nicoflowers@gmail.com
Guest
Posts: n/a
 
      3rd Jun 2008
Hello,

I made a VBA EXCEL program which can open, write and close a file
(.xml), I would like to know how to do so when I click on a
"CommandButton", a window appears which display the brtowse for folder
dialog

Kinds regards.

For now :
Private Sub CreateFile(Line As String)
Dim FileName As String
Dim NewLine As String
Dim X As String, w As String, RulesInform As String

Rulename = TextBox11.Value

X = Rulename
w = ".xml"

RulesInform = X & w


FileName = "C:\Documents and Settings\q737318\Desktop\AuToRules
\RESULT1\" & RulesInform
Dim FileNum As Integer
FileNum = FreeFile
NewLine = ReplaceTag(Line)
Open FileName For Append As #FileNum ' creates the file if it
doesn't exist
Print #FileNum, NewLine ' write information at the end of the text
file
Close #FileNum ' close the file
End Sub

 
Reply With Quote
 
 
 
 
Smart Akhtar
Guest
Posts: n/a
 
      3rd Jun 2008
Hi nic

use this code to see the folders browser window
and select the folder as per your need.

Application.FileDialog(msoFileDialogFolderPicker).InitialFileName = "C:
\" ' Give your own path"
Application.FileDialog(msoFileDialogFolderPicker).Show


On Jun 3, 2:21*pm, nicoflow...@gmail.com wrote:
> Hello,
>
> I made a VBA EXCEL program *which can open, write and close a file
> (.xml), I would like to know how to do so when I click on a
> "CommandButton", a window appears which display the brtowse for folder
> dialog
>
> Kinds regards.
>
> For now :
> Private Sub CreateFile(Line As String)
> Dim FileName As String
> Dim NewLine As String
> Dim X As String, w As String, RulesInform As String
>
> Rulename = TextBox11.Value
>
> * * X = Rulename
> * * w = ".xml"
>
> * * RulesInform = X & w
>
> FileName = "C:\Documents and Settings\q737318\Desktop\AuToRules
> \RESULT1\" & RulesInform
> Dim FileNum As Integer
> * * FileNum = FreeFile
> * * NewLine = ReplaceTag(Line)
> * * Open FileName For Append As #FileNum ' creates the file if it
> doesn't exist
> * * Print #FileNum, NewLine ' write information at the end of the text
> file
> * * Close #FileNum ' close the file
> End Sub


 
Reply With Quote
 
shiro
Guest
Posts: n/a
 
      5th Jun 2008
I'm sorry,
I used your code but it doesn't make a sense.
How to write it.


"Smart Akhtar" <(E-Mail Removed)> wrote in message
news:0e564aa1-d654-4b42-a8ec-(E-Mail Removed)...
Hi nic

use this code to see the folders browser window
and select the folder as per your need.

Application.FileDialog(msoFileDialogFolderPicker).InitialFileName = "C:
\" ' Give your own path"
Application.FileDialog(msoFileDialogFolderPicker).Show


On Jun 3, 2:21 pm, nicoflow...@gmail.com wrote:
> Hello,
>
> I made a VBA EXCEL program which can open, write and close a file
> (.xml), I would like to know how to do so when I click on a
> "CommandButton", a window appears which display the brtowse for folder
> dialog
>
> Kinds regards.
>
> For now :
> Private Sub CreateFile(Line As String)
> Dim FileName As String
> Dim NewLine As String
> Dim X As String, w As String, RulesInform As String
>
> Rulename = TextBox11.Value
>
> X = Rulename
> w = ".xml"
>
> RulesInform = X & w
>
> FileName = "C:\Documents and Settings\q737318\Desktop\AuToRules
> \RESULT1\" & RulesInform
> Dim FileNum As Integer
> FileNum = FreeFile
> NewLine = ReplaceTag(Line)
> Open FileName For Append As #FileNum ' creates the file if it
> doesn't exist
> Print #FileNum, NewLine ' write information at the end of the text
> file
> Close #FileNum ' close the file
> End Sub




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Browse For Folder' dialog bix is blank =?Utf-8?B?Z19kZW5uZQ==?= Windows XP General 3 6th Sep 2006 08:25 PM
How to get removable drive to display in 'Browse for Folder' dialog? Richard Lewis Haggard Windows XP General 4 1st Feb 2006 09:03 PM
Browse for folder dialog VB Joshua Microsoft ASP .NET 3 3rd Sep 2004 12:21 AM
Browse Folder dialog with option to make New Folder Bradley C. Hammerstrom Microsoft Access Getting Started 2 6th Jan 2004 07:33 AM
Browse for Folder dialog box Arunas Microsoft Access VBA Modules 1 5th Nov 2003 11:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:08 PM.