Simple question about FORM / SAVE & EXCEL

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Forcing Jaws PDF Creator 1
IE automation 5
IE Automation 1
Excel Concatenate Form Name to Parse for function 1
Worksheet copying in Excel 2007 3
Application.Close 2
Saving Files 2
Excel 2007 Save as .xlsm 3

Back
Top