troubleshooting Question

Microsoft VBScript compilation error '800a0401'

Avatar of keerthimothukuri
keerthimothukuriFlag for United States of America asked on
VB Script
1 Comment1 Solution425 ViewsLast Modified:
hi ,
i getting the following error ,can anyone plz help me out
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/SUB_only/Risk_Mgmt/SIMS_EW_Status/Today_EW_Status_SEA.asp, line 298
strMailBody = strMailBody &  var oXL = new ActiveXObject("Excel.Application")& Chr(13) & Chr(10)

here is a part of my code


Function makeBodyHeader(strSubCd, strCfgType)

      Dim strURL, strMailBody

      If MAILTYPE = "TEST" Then
            'strURL = URL_PATH & "/login/Introduction.asp?usrid="  & EncodeBySType(strUserID & chr(8) & gCurrentDate)
            strURL = URL_PATH & "/"
      Else
            'strURL = URL_PATH & "/login/createcookie.asp?USER_ID="  & EncodeBySType(strUserID)
            'strURL = URL_PATH & "/login/createcookie.asp?USER_ID="  & EncodeBySType(strUserID & chr(8) & gCurrentDate)
            strURL = URL_PATH & "/"
      End If

      strMailBody = ""
      strMailBody = strMailBody & "<html>" & Chr(13) & Chr(10)
      strMailBody = strMailBody & "<script language='javascript'>" & Chr(13) & Chr(10)
      strMailBody = strMailBody & vbTab & "var url='" & strURL & "';" & Chr(13) & Chr(10)
      strMailBody = strMailBody & vbTab & "var win_view=window.open(url, 'SIMS');" & Chr(13) & Chr(10)
      strMailBody = strMailBody & vbTab & "'win_view.focus();" & Chr(13) & Chr(10)
      strMailBody = strMailBody & "</script>"

      strMailBody = strMailBody & "<%@language= "JavaScript"%>" & Chr(13) & Chr(10)
      strMailBody = strMailBody &  "function bringToExcel() {" & Chr(13) & Chr(10)
      strMailBody = strMailBody &  this.document.execCommand("SelectAll", false) & Chr(13) & Chr(10)
      strMailBody = strMailBody &  this.document.execCommand("Copy", true) & Chr(13) & Chr(10)
      strMailBody = strMailBody &  this.document.execCommand("UnSelect", false) & Chr(13) & Chr(10)
      strMailBody = strMailBody &  var oXL = new ActiveXObject("Excel.Application")& Chr(13) & Chr(10)
      strMailBody = strMailBody &  oXL.Visible = true & Chr(13) & Chr(10)
      strMailBody = strMailBody & var oWB = oXL.Workbooks.Add() & Chr(13) & Chr(10)
      strMailBody = strMailBody &  var oSheet = oWB.ActiveSheet & Chr(13) & Chr(10)
      strMailBody = strMailBody & oSheet.Paste() & Chr(13) & Chr(10)
      strMailBody = strMailBody & oXL.Visible = true & Chr(13) & Chr(10)
      strMailBody = strMailBody &  oXL.UserControl = true & Chr(13) & Chr(10)
      strMailBody = strMailBody & } & Chr(13) & Chr(10)
      strMailBody = strMailBody & "</script>" & Chr(13) & Chr(10)
      strMailBody = strMailBody & vbNewLine
                  strMailBody = strMailBody & "<table border=0 cellpadding=1 cellspacing=0 width='100%' style='font-family:tahoma;font-size:8pt;'>" & Chr(13) & Chr(10)


ASKER CERTIFIED SOLUTION
rejoinder
Manager, IT
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros