Roderick_E
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 2,051
Why am I getting a syntax error? Calling from a userform button. Thanks
Code:
Private Sub CommandButton1_Click()
Dim modname As String
Dim twb As String
strfiletoopen = Application.GetOpenFilename _
(Title:="Please choose a file to open", _
FileFilter:="Excel Files *.xls* (*.xls*),")
'CopyModule(strFiletoopen, "Module1", ThisWorkbook)
modname = "test1"
twb = "test2"
[COLOR=#ff0000]testit (strfiletoopen,modname,twb)[/COLOR]
End Sub
Code:
Function testit(sourcewb As String, modname As String, targetwb As String)
MsgBox sourcewb & "--" & modname & "--" & targetwb
End Function