DavidSystems
New Member
- Joined
- Oct 7, 2013
- Messages
- 5
Hi all,
I new to the site and still a bit new to VBA. What I am trying to do is open a user form and allow the user to pick a file (perhaps a few files in the future) open it and display the file name with one button click. Then use another control bottun to do the work of getting the needed info and update other workbooks. To do this I am trying to make a Public Variables so I can keep referencing the file when swithcing back and forth. For some reason it crashes on the public varb.
code from the design mode
Private Sub CommandButton2_Click()
Public FileName As String
OpenFile.Show
End Sub
i tried the same process without the userform and crashed at the same place. Any suggestions on what I am doing wrong. I have look at the sysntax of a public variables and it seems to be correct.
I new to the site and still a bit new to VBA. What I am trying to do is open a user form and allow the user to pick a file (perhaps a few files in the future) open it and display the file name with one button click. Then use another control bottun to do the work of getting the needed info and update other workbooks. To do this I am trying to make a Public Variables so I can keep referencing the file when swithcing back and forth. For some reason it crashes on the public varb.
code from the design mode
Private Sub CommandButton2_Click()
Public FileName As String
OpenFile.Show
End Sub
i tried the same process without the userform and crashed at the same place. Any suggestions on what I am doing wrong. I have look at the sysntax of a public variables and it seems to be correct.