Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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
 
Old September 9th, 2007, 08:23 PM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with export to excel

i am opening the query in access and exporting it to existing worksheet within the existing excel file ,as in below code

Private Sub Command59_Click()

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "queryname", "pathname", , "worksheetname"


End Sub

------------------------------------------------------------

the above code when run says "cannot update.database or object is read-only "

can u help me wit this please....

supreeth
 
Old September 9th, 2007, 08:25 PM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

help...

Quote:
quote:Originally posted by supreeth
 i am opening the query in access and exporting it to existing worksheet within the existing excel file ,as in below code

Private Sub Command59_Click()

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "queryname", "pathname", , "worksheetname"


End Sub

------------------------------------------------------------

the above code when run says "cannot update.database or object is read-only "

can u help me wit this please....

supreeth
supreeth
 
Old September 10th, 2007, 03:04 AM
Registered User
 
Join Date: Oct 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi supreeth

The only thing I can see that would stop this from exporting is that you have a names range going into the export file. If this export file is a workbook that already exists, it may be that it is already open, which means you cannot export to it. Try exporting without the the worksheet name, see if this work first.

Tell them they will hear,
Show them they will see,
Let them experience and they will learn





Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Export then Import problem courtney_ctisn Classic ASP Basics 8 October 18th, 2007 09:57 AM
Crystal Report Export problem to excel spmano1983 VB.NET 0 August 17th, 2007 01:33 AM
Export to Excel ramuis78 ASP.NET 2.0 Basics 2 May 30th, 2007 05:51 AM
EXPORT DATAGRID TO EXCEL FORMATTING PROBLEM akshay144 VS.NET 2002/2003 2 October 31st, 2006 01:10 PM





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