Exporting an Excel Spreadsheet to HTML via Visual Basic

The following syntax is failing when run as Open Event Procedure within an Access form.

I suspect it might be the "8" spreadsheet type and our Access 2002 being dated compared to the Excel 2010 software used to create the xlsx file.
But I'm hoping it's something else.

The tblCOIvendors is a simple design of just two fields: Vendor (text=255) and ExpDate (as Date).
I get the "Run-time error 3274, External table is not in the expected format."


Rem Copy scanfield's "2013 Certificates of Insurance from Vendors.xlsx" to COIvendors.htm
Rem
DoCmd.TransferSpreadsheet acImport, 8, _
   "tblCOIvendors", "\\bordensrv\users\scanfield\2013 Certificates of Insurance from Vendors.xlsx", _
   False, "A6:B99"
DoCmd.OutputTo acOutputQuery, "qryCOIvendors", acFormatHTML, "\\bordensrv\intranet\reports\COIvendors.htm", True
Rem
slamondAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
So you're running this in Access 2010, and you're opening spreadsheets created with Excel 12 or higher?

If so try this:

DoCmd.TransferSpreadsheet acImport, acSpreadsheettypeExcel12, _
   "tblCOIvendors", "\\bordensrv\users\scanfield\2013 Certificates of Insurance from Vendors.xlsx", _
   False, "A6:B99"
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Oops ... sorry, I think you're running Access 2002. That constant would not be available in 2002.

You would need to get a different version of the spreadsheet, one that is compliant with your version of Office - or upgrade your Office version (which is what you really should do).
0
slamondAuthor Commented:
I opened the spreadsheet in Excel 2003 and saved it as XLS and changed the file code to 8 as follows:

DoCmd.TransferSpreadsheet acImport, 8, _
   "tblCOIvendors", "\\bordensrv\users\scanfield\2013 Certificates of Insurance from Vendors.xls", _
   False, "A6:B99"
DoCmd.OutputTo acOutputQuery, "qryCOIvendors", acFormatHTML, "\\bordensrv\intranet\reports\COIvendors.htm", True

The error is "Run-time error 3270; Property Not Found".

The Debugger highlights the first line, so I assume that's where the error is.

Hopefully it's a typo that I'm just not noticing.

From within my session, I'm able to open the source Excel file, the Access destination table and the query. So I don't believe that their availability is the issue.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I don't see anything wrong with your first line, or your second.

Perhaps you could try removing the Range argument, and see if that works. I'm not sure when that as introduced, although I'm fairly confident it was available in 2002.

In other words - start with only those items which are required, and then add the optional elements to find out where it fails.
0
slamondAuthor Commented:
I have been sidetracked with other issues. I am simply updating my status so the system's robot doesn't deep six by question.
:)

I'll be back ASAP.
S.
0
slamondAuthor Commented:
I solved the issue by changing the Field Name option to "True" and labeling the column headers to match the field names in the destination table.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slamondAuthor Commented:
I followed the lead of the expert and found a related solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.