If I have a database of various scripts. Is there a way that I can launch
the Script contained in the "Script" textbox using the On_click event of a
run button?
Thank you,
Daniel
Not exactly sure what you are asking... My first thought is you would have
to place "=RunMyScript()" in the OnClick event of the Run button. Hope this
is what you were looking for.
> If I have a database of various scripts. Is there a way that I can launch
> the Script contained in the "Script" textbox using the On_click event of a
[quoted text clipped - 3 lines]
>
> Daniel
Daniel - 13 Dec 2005 02:38 GMT
Suppose I have the following in a MEMO field named "Script" in my form (which
contains vbscripts). I would like to know what vba code could be used in
conjunction with the on_click event to run the code.
******
Const xpRangeAutoFormatList2 = 8
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)
x=1
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service")
For Each ObjItem in colItems
objWorksheet.Cells(x,1) = objItem.Name
objWorksheet.Cells(x,2) = objItem.DisplayName
objWorksheet.Cells(x,3) = objItem.State
x = x + 1
Next
Set objRange = objWorksheet.UsedRange
objRange.EntireColumn.Autofit()
objRange.Autoformat(xpRangeAutoFormatList2)
******
> Not exactly sure what you are asking... My first thought is you would have
> to place "=RunMyScript()" in the OnClick event of the Run button. Hope this
[quoted text clipped - 7 lines]
> >
> > Daniel