M
Michael W
Hi,
I have a module and userform1 in the doc. My module has six main functions
that will be run once user click a custom toolbar that's connected for each
function. The userform purpose is simply to let user input the value and
then call a function that will process the value further.
My questions is simple, how would I get to run the form and get the value
for my function(Sub ConvertMTP)module?
Thank you
My userform code:
Sub CommandButton1_Click()
Unload Me
End
End Sub
Sub CommandButton2_Click()
If TextBox1.Value = "" Or TextBox2.Value = "" Then
MsgBox ("You must input the Application Name and its Functional Area")
TextBox1.SetFocus
Else
Application = TextBox1.Value
Functional = TextBox2.Value
ChildFA = TextBox3.Value
Unload Me
NewMacros.ConvertMTP
End If
End Sub
Sub CommandButton3_Click()
TextBox1.Value = Null
TextBox2.Value = Null
TextBox3.Value = Null
End Sub
Sub Form_load()
TextBox1.SetFocus
userform1.Show
End Sub
My module function:
Sub ConvertMTP()
'
' ConvertMTP Macro
' Macro created 8/21/2006 by Business Objects
'
Dim Test As FormField
Load userform1
userform1.Show
' I try to get userform1 textbox1 value, but fail
'MsgBox (Test.TextBox1.Value)
'Create text file
Const ForWriting = 2
Dim objDialog, intReturn, objFSO, objFile, Wscript
Set objDialog = CreateObject("SAFRCFileDlg.FileSave")
objDialog.FileName = "TCS.MTP"
objDialog.FileType = "QACenter MTP File Type (*.MTP)"
intReturn = objDialog.OpenFileSaveDlg
If intReturn Then
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(objDialog.FileName, ForWriting,
True)
Else
Wscript.Quit
End If
'
objFile.WriteLine ("[MTP]")
objFile.Write ("Name=")
'
objFile.Close
I have a module and userform1 in the doc. My module has six main functions
that will be run once user click a custom toolbar that's connected for each
function. The userform purpose is simply to let user input the value and
then call a function that will process the value further.
My questions is simple, how would I get to run the form and get the value
for my function(Sub ConvertMTP)module?
Thank you
My userform code:
Sub CommandButton1_Click()
Unload Me
End
End Sub
Sub CommandButton2_Click()
If TextBox1.Value = "" Or TextBox2.Value = "" Then
MsgBox ("You must input the Application Name and its Functional Area")
TextBox1.SetFocus
Else
Application = TextBox1.Value
Functional = TextBox2.Value
ChildFA = TextBox3.Value
Unload Me
NewMacros.ConvertMTP
End If
End Sub
Sub CommandButton3_Click()
TextBox1.Value = Null
TextBox2.Value = Null
TextBox3.Value = Null
End Sub
Sub Form_load()
TextBox1.SetFocus
userform1.Show
End Sub
My module function:
Sub ConvertMTP()
'
' ConvertMTP Macro
' Macro created 8/21/2006 by Business Objects
'
Dim Test As FormField
Load userform1
userform1.Show
' I try to get userform1 textbox1 value, but fail
'MsgBox (Test.TextBox1.Value)
'Create text file
Const ForWriting = 2
Dim objDialog, intReturn, objFSO, objFile, Wscript
Set objDialog = CreateObject("SAFRCFileDlg.FileSave")
objDialog.FileName = "TCS.MTP"
objDialog.FileType = "QACenter MTP File Type (*.MTP)"
intReturn = objDialog.OpenFileSaveDlg
If intReturn Then
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(objDialog.FileName, ForWriting,
True)
Else
Wscript.Quit
End If
'
objFile.WriteLine ("[MTP]")
objFile.Write ("Name=")
'
objFile.Close