View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Barlow Tim Barlow is offline
external usenet poster
 
Posts: 34
Default Simple question about FORM / SAVE & EXCEL

Alex,

I would save the path to a cell on a worksheet (which could be hidden). Then
when the form is initiated, set the text input box to the saved data - e.g.

save the data when the form closes with something like:
Private Sub UserForm_Terminate()
Sheets("Sheet3").Range("A4") = TextBox1
End Sub

and when the form initiates use something like:
Private Sub UserForm_Initialize()
TextBox1 = Sheets("Sheet3").Range("A4")
End Sub

HTH

Tim


"Alex" wrote in message
oups.com...
Hello!,

A simple macro opens a form with

-a simple text input box (which ask for a file) i.e. the default path
and

-a command button which starts a macro.

Private Sub Workbook_Open()

myForm.Show

At the end of the macro I'd like to change the default value for the
text input box with the text (path) the user entered and save the file.
I can't do that.

Even if I save the Excel file with the diskette icon (after changing
the value) or Activeworkbook.save , the next time I start the Excel the
input box of the form has still its original default value.

Where did I wrong?.

Thanks,

Ale.