title: Can one programmatically refresh a Tableau report without Tableau Server?
body: <p>I have Tableau Desktop 9.2, Professional Edition. I would like to be able to have a scheduled job which would open a workbook, refresh a dashboard, and generate a PDF. Can anyone suggest a way?</p>
  
  <p>UPD. I came across <a href="https://www.youtube.com/watch?v=FsJRD4iJmwI" rel="nofollow">this</a> approach, suggested by Dafang Wu.  </p>
  
  <p>My current AutoIt script is</p>
  
  <pre><code>Local $tableaufile = "C:\test.twb"
  
  WinActivate($tableaufile);
  WinWaitActive($tableaufile);
  
  Send("!f",0);
  Send("D");
  
  WinWaitActive("Print to PDF");
  Send("{ENTER}"); Send enter key
  WinWaitActive("Save PDF");
  Send("test unique name");
  Send("{ENTER}");
  </code></pre>
  
  <p>Unfortunately, this does not work: when I open the script in SciTE Script Editor and hit F5, the process does not exit - I have to Ctrl-Break - and there is no PDF file.</p>
  
  <p>UPD2. Corrected the first WinWait call, and switched to MouseClick's - still no joy.</p>
  
  <pre><code>Local $tableaufile = "C:\Users\Dimitri Shvorob\Documents\My Tableau Repository\Workbooks\test.twb"
  WinActivate($tableaufile);
  WinWait("Tableau - test", 10);
  Send("!f",0);
  Send("D");
  MouseClick("Left", 829, 523);
  MouseClick("Left", 1248, 690);
  WinKill("Tableau - test");
  </code></pre>