Just wondering if anyone could help me out with a basic question. So I have an embedded workbook in a sharepoint webpart and I am trying to have the workbook size dynamically with the size of the browser.

Your problem has to do with the way you originally are embedding the viz into the web page. You using an older mechanism to do this work (note the v1 in the name of the JavaScript file), but then trying to resize it with a "newer" mechanism. That won't work.

the code sample you found assumes the viz was embedded the new way. Yvan read more about this by googling Tableau JacaScript API Tutorial. It will walk you through how to embed the "new way" which will work with your found code sample.