Apple Script and Web Queries in Excel

J

jim_in_dh

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

I am trying to create a web query in Excel 2008 with Applescript. I can make the query run manually, but whenever I run my
script, I get a message that says the object is not found (the query table). When I try to 'make' or 'select' the query table,
I get a message that says I cannot make class query table.
Here is my script

set webqueryfile to ¬
"file path name"
tell application "Microsoft Excel"
set WkBk to open workbook workbook file name ¬
"spreadsheet name"
set newSheet to make new worksheet at beginning of active workbook with properties ¬
{query type:web query, connection:webqueryfile, destination:"a1"}
activate newSheet
set qt to make new query table of active workbook -- AT THIS POINT THE CANNOT MAKE CLASS QUERY TABLE ERROR occurs
-- set fill adjacent formulas of query table 1 ¬ -- this line is from the MS developers site. If I comment out the above line,
-- of sheet newSheet to true -- and uncomment these lines, I get the message OBJECT DOES NOT EXIST.

end tell

Thanks for any suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top