Dan Clements Report post Posted 06/12/2003 04:49 AM I get a type mismatch error line 17 character 1. Can someone help. I don't understand much about VB script. I want the IVR to remember, from the prior call, What line, of 2, the call was transfered to and then send the new call to the other line. I have no luck with the Eval funtions, it seams that $RV's become empty at the end of a call. I am now trying to set up a VB that changes an excel field, Cell (1,1), form a 1 to a 2 and then from a 2 to a 1 based on the prior call. Am I making this too difficult ?? is their an easier way? Dim xlApp 'Excel.Application Dim xlBook 'Excel.Workbook dim xlSht Dim filename, value1, sReturnedRVs filename = "c:\Agcy WAVS\Upagent.xls" Set xlApp = CreateObject("Excel.Application") set xlBook = xlApp.WorkBooks.Open(filename) set xlSht = xlApp.activesheet value1 = Abs(Cint(xlSht.Cells(1, 1).Value)) sReturnedRVs = "[value1]{" & value1 & "}" iRet = WriteResultFile(sReturnedRVs) workbook.close False excel.quit Share this post Link to post
SupportTeam Report post Posted 06/12/2003 07:34 AM The script uses the "WriteResultFile" function - but that function itself has not been included: function WriteResultFile(strResult) const ForReading=1, ForWriting=2, ForAppending=8 Dim filename, fso, ts, outdata, outdata2, outdata3 filename = "VGRUNRESULT_$RV_DEVICEID.TXT" set fso = CreateObject("Scripting.FileSystemObject") set ts = fso.OpenTextFile(filename, ForWriting, True) ts.WriteLine(strResult) ts.Close WriteResultFile = 0 end function there were a few problems furhter down as well... try using this: Dim xlApp 'Excel.Application Dim xlBook 'Excel.Workbook dim xlSht Dim filename, value1, sReturnedRVs filename = "c:\Agcy WAVS\Upagent2.xls" Set xlApp = CreateObject("Excel.Application") set xlBook = xlApp.WorkBooks.Open(filename) set xlSht = xlApp.activesheet value1 = Abs(Cint(xlSht.Cells(1, 1).Value)) sReturnedRVs = "[value1]{" & value1 & "}" iRet = WriteResultFile(sReturnedRVs) xlBook.close False xlApp.quit function WriteResultFile(strResult) const ForReading=1, ForWriting=2, ForAppending=8 Dim filename, fso, ts, outdata, outdata2, outdata3 filename = "VGRUNRESULT_$RV_DEVICEID.TXT" set fso = CreateObject("Scripting.FileSystemObject") set ts = fso.OpenTextFile(filename, ForWriting, True) ts.WriteLine(strResult) ts.Close WriteResultFile = 0 end function Result Variables are only valid during the current call - but if you want to schedule a new call from within the current call you can pass the Result Variables as parameters - see the "Variables" text box of the "Send Phone Message" module... Share this post Link to post
Guest Skulltor Report post Posted 09/15/2004 12:17 AM Excellent code thanks Share this post Link to post
SupportTeam Report post Posted 09/15/2004 03:24 AM Current versions of VoiceGuide no longer need to "Write a Result File" - they can just return info back to VG using one of the COM functions. See: http://www.voiceguide.com/vghelp/html/com_...esultReturn.htm http://www.voiceguide.com/vghelp/html/com_...Script_Goto.htm http://www.voiceguide.com/vghelp/html/com_...cript_Gosub.htm etc. Some more VBScript samples are also at: http://www.voiceguide.com/vghelp/html/modVbs.htm Share this post Link to post