在vb里写了一个变量,想让asp里能取到它的值,vb程序还要改什么
 Public   Function   aspexcel(ByVal   SQLStr   As   String)   As   Boolean 
 略 
                                  Dim   sfilename   As   String 
       sfilename   =   CStr(FormatDateTime(Now,   0)) 
       sfilename   =   App.path   &    "\ "   &   sfilename   &    ".xls " 
                Set   xlBook   =   xlApp.Workbooks.Add 
                   xlBook.SaveAs   (sfilename) 
                Set   xlSheet   =   Nothing 
             aspexcel   =   True 
             Exit   Function 
 End   Function
------解决方案--------------------.........................   
 Option Explicit 
 Private ScriptingContext As ScriptingContext 
 Private Request As Request 
 Private Response As Response 
 Private Server As Server 
 Private Session As Session   
 Public Sub OnStartPage(PassedScriptingContext As ScriptingContext) 
     Set ScriptingContext = PassedScriptingContext 
     Set Request = ScriptingContext.Request 
     Set Response = ScriptingContext.Response 
     Set Server = ScriptingContext.Server 
     Set Session = ScriptingContext.Session 
 End Sub   
 Public Sub OnEndPage() 
     Set ScriptingContext = Nothing 
     Set Request = Nothing 
     Set Response = Nothing 
     Set Server = Nothing 
     Set Session = Nothing 
 End Sub   
 Public Function aspexcel(ByVal SQLStr As String) As Boolean 
 略 
            Dim sfilename As String 
   sfilename = CStr(FormatDateTime(Now, 0)) 
   sfilename = App.path &  "\ " & sfilename &  ".xls " 
      Set xlBook = xlApp.Workbooks.Add 
       xlBook.SaveAs (sfilename) 
      Set xlSheet = Nothing 
     aspexcel = True 
     Exit Function 
 End Function   
 ..............   
 生成并注册dll, asp: 
  <% 
 dim clsProject 
 set clsProject = server.createobject( "工程名.class名 ") 
 response.write clsProject.aspexcel(.....) 
 %>
------解决方案--------------------呵呵,你在VB里写的就是组件.调用组件内的过程或函数,必须这么写.
------解决方案--------------------就是啦 
 像Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)这些过程要来有什么用
------解决方案--------------------to renjun24(我知道我还很差,但是我会努力的! 同时也谢谢每个人对) ( ) : 
 将asp变量导入组件,组件处理完毕,返回值. 
 不是复杂.而是用VB写组件.上面两个过程是必须的.   
 to devms(): 
 上面两个过程是必须的.要建立Web对象,才能为Web所用.   
 这和.net中,创建Web用的类时, 需要using System.Web(C#.NET) Imports System.Web(VB.NET) 
 一样的意思.
------解决方案--------------------sfilename如果是表单项的东东,你在组件中可以写: 
 ...................   
 Public Function aspexcel(ByVal SQLStr As String) As Boolean 
     Dim sfilename as string = Trim(Request.Form( "XXX "))  '上面过程取得了Request,即可在组件中使用Request对象.   
    Dim sfilename As String 
   sfilename = CStr(FormatDateTime(Now, 0)) 
   sfilename = App.path &  "\ " & sfilename &  ".xls " 
      Set xlBook = xlApp.Workbooks.Add 
       xlBook.SaveAs (sfilename) 
      Set xlSheet = Nothing 
     aspexcel = True 
     Exit Function 
 End Function 
 .......................