I suppose you are trying to create an Excel interface for an ARENA simulation...?
It would be helpful to know which line of your code caused the error. Click on the Debug button when the error message appears, and you will see the line that causes the error highlighted in yellow. Let us know which line that is.
I believe it is the last line MsgBox(TextBox1) is the one causing the error. AFAIK, MsgBox takes a string parameter, whereas you're passing a TextBox object. I believe it should be MsgBox(TextBox1.value). Try and let us know.
MsgBox(TextBox1) works fine. In case you do not specify, VB will take the default property of the text box, .Value, which will then return the text within the box (the last value of the .Text property). See also: https://msdn.microsoft.com/en-us/library/office/aa173476(v=office.11).aspx
Can you check the following: copy this line before theMod.Data("value") = ...
Debug.Print "xx-" & theMod.Data("value") & "-xx"
If this line gives the same error, you most likely don't have a "value" field in your Data table. Maybe it is called "Value"? as in theMod.Data("Value")
Set fso = Server.CreateObject(script.systemobject) Set f = fso.CreateTextFile(FileName,True) f.WriteLine body f.Close Set f = Nothing Set fso = Nothing 换成 Set stm = server.createobject("ADODB.Stream") stm.Charset = "gb2312" stm.Open stm.WriteText body stm.SaveToFile FileName, 2