VoiceGuide IVR Software Main Page
Jump to content

Saving Data To MS Excel

Recommended Posts

Massimo wrote:

Hello, i have develop this flow from clients to storage data in excel file.

Then in excel file i want to store even the Name of the caller over the CIDnumber (present in Database).

 

The VBscript is:

Dim xlApp, xlBook, xlSht
Dim filename, value1, value2, value3, value4, Name

on error resume next

filename = "c:\warehouse.xls"

Set xlApp = CreateObject("Excel.Application")
set xlBook = xlApp.WorkBooks.Open(filename)
set xlSht = xlApp.activesheet
'assign to Name the result of variable from DB, position 1_1
Name = $RV[GetClientRecord_1_1]
xlApp.DisplayAlerts = False

'write data into the spreadsheet
xlSht.Cells(2, 1) = $RV_CIDNUMBER
xlSht.Cells(2, 2) = Name
xlSht.Cells(2, 3) = $RV[GetNumbersContatore]
xlBook.Save
xlBook.Close SaveChanges=True
xlApp.Close
xlApp.Quit

'always deallocate after use...
set xlSht = Nothing 
Set xlBook = Nothing
Set xlApp = Nothing

 

Where is the problem?

Can you advise me?

 

Thanks

Massimo

post-2-1089916748.gif

Share this post


Link to post

I suspect you should change:

 

Name = $RV[GetClientRecord_1_1]

 

to:

 

Name = "$RV[GetClientRecord_1_1]"

 

All strings should be surrounded with quotes...

 

if that does not fix it try removing the

 

on error resume next

 

from the VBScript and see what error message pops up when you run the script.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×