Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 27th, 2004, 11:20 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default Save Browser Content

I am trying to automate a procedure. I have a situation where I must retrieve a spreadsheet from a remote server to update our system. I log into the application select the type of report I need and enter a date range then submit. The results are generated by Cold Fusion (cfm page) in a spreadsheet format.

What I have done is create a script that will start an InternatExplorer.Application, use the IE navigate method to load a form that submits with an onLoad event handler, passing the appropriate UserName and Password to log me in to the app. Then I navigate to the correct URL (with date range parameters) that generates the report I need.

I have two needs:

1) I need a way to save the content from my browser to a specified location, whereby I can query the spreadsheet and update our system automatically. I have tried the ExecWb method, however I cannot select the location that I want to save the file to. By default the file is saved in "My Documents", MOST of the time (ie. not reliable).

My code for saving is as follows:

objIe.ExecWB 4, 2, 0, 0



2) Also when I try to query the spreadsheet, I get an error that says, "External table is not in the expected format". However, when I manually open the file and save it with Excel, I can query it. The connection string that I am using is as follows:

set cn = WScript.CreateObject("Adodb.Connection")
cn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & objFilePath & objFile & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"


Any help with this would be greatly appreciated as I am tired of wracking my brains over this. I know you're all smart so someone should have a solution that they have used. Thanks in advance people. Thanks a ton.

Dave






Similar Threads
Thread Thread Starter Forum Replies Last Post
save content combobox tankfrank35 Beginning VB 6 4 September 26th, 2007 08:16 AM
Send and Receive XML content through browser kj875 ASP.NET 2.0 Basics 0 July 27th, 2007 12:10 AM
how i can save my file content into a table chandanbhakuni Classic ASP Professional 0 July 14th, 2006 07:23 AM
Viewing code rather than content in browser aspnewbie Classic ASP Basics 2 March 27th, 2006 10:47 AM
to save datagrid content to a excel sheet josna VB.NET 1 March 4th, 2006 07:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.