Solved

download livelink document to access table

Posted on 2014-09-18
5
345 Views
Last Modified: 2014-09-18
I am trying to download a livelink document, which presents as an Excel format, into an Access table.

When I run the code below, once the table is found, I am presented with the following error message - "database does not suport HTML pages".  I have no idea what this error means or how to fix it.  

My simple test code is as follows:

Sub getData()

   Dim strFileName$
   
 strFileName = "http://docweb.company.com/doc/livelink/Contact%20List?func=docfetcher.fetchdoc&nodeid=582331501"
   
 DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "tmpContact", strFileName, True

End Sub

Is the docmd.transferspreadsheet method what I should be using?  Or, should I be using something else - if so, what?
0
Comment
Question by:uad
  • 2
  • 2
5 Comments
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 200 total points
ID: 40331419
I've run into this before with downloaded Excel files. I've had to open them in Excel and save them as standard Excel files before the Import would work, so you'd have to change your process to :

1. Download the file
2. OPen the file in excel and Save it as a standard Excel file
3. Then run your process.

Perhaps another Expert has a a different way, however ...
0
 

Author Comment

by:uad
ID: 40331551
Ok - not what I wanted to hear.

I do have an Excel macro that will call and save the file, but is there a way to create an access module to call this excel macro?
0
 
LVL 84
ID: 40331555
You could automate Excel, and then run that macro I assume, but I have no experience with doing that.
0
 
LVL 12

Accepted Solution

by:
danishani earned 300 total points
ID: 40331646
You can use the Excel Object within Microsoft Access and run the procedure (macro) you have written.

 Dim XL As Object
 Set XL = CreateObject("Excel.Application")
 XL.Workbooks.Open "YourPathandFileNameHere"
 ...
 'Then put here all your further stuff you want to run

Open in new window


Then when the macro is finished you can import the Excel file (assuming that's the format you save it in) with the DoCmd.TransferSpreadSheet() command.

Hope this helps,
0
 

Author Closing Comment

by:uad
ID: 40331665
Split point since I need both solutions for the end result
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question