2 Replies Latest reply on Feb 1, 2017 5:03 PM by Russell Christopher

    Generate CSV file via Microsoft.XMLHTTP object in Tableau 10.1.3

    indrasena.reddy.0

      Hi All,

       

      Last year, we implemented an automated vba program which uses the Microsoft.XMLHTTP to generate CVS files automatically from Tableau workbooks based on parameters configured in the program.

       

      This has been working very well from last one year on server version 9.3 without any performance issues, but after we have upgraded the server to 10.1.3 recently, the files are being generated very slowly, Not sure, what is causing this slowness in 10.1.3. Please note, the same report when run from Tableau server is running fine in expected time and also when we directly run the URL with .csv appended (to have the csv file generated) it is generating the file fast, but when the csv file is generated using the Microsoft.XMLHTTP it is taking lot of time, like more than twice the time with other methods mentioned. Earlier in version 9.3 this was not the case at all, the csv files via the vba prgram using Microsoft.XMLHTTP object were generating very fast.

       

      Below is the sample code snippet we use to generate the csv files:

      Dim WinHttpReq As Object

       

      Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")

          WinHttpReq.Open "GET", reportURL, False

          WinHttpReq.Send 'It is taking unusually long time here, not sure if this is due any authentication checks?

          DoEvents

               

          reportURL = WinHttpReq.ResponseBody

          DoEvents

         

         

          If WinHttpReq.Status = 200 Then

              Set oStream = CreateObject("ADODB.Stream")

              oStream.Open

              oStream.Type = 1

              oStream.Write WinHttpReq.ResponseBody

              oStream.SaveToFile (strDirectoryPath & "Data_File.csv"), 2

              oStream.Close

          End If

       

      Please note, since this code is already working from last one year, and changing it to use Tabcmd would take sometime, so would request if Tableau engineers could suggest a fix for the existing code with regards to performance.

       

      Appreciate your help.

       

      Thank you.