Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 17th, 2003, 11:50 AM
Registered User
Join Date: Dec 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Exporting data to Excel

I am trying to export data from Access to Excel and then subsequently send the data via Outlook to particular users. Using the following code, I was able to get the data to export once, but can't seem to get it to export again. I receive the following error:

Run-time error 3422: Can't modify table structure. Another user has the table open.

    Function ExporttoExcel()
    'Open Excel Workbook, export the data, then close the wkbk.

    Dim openWorkbook As Object, name As String
    Set openWorkbook = Workbooks.Open("D:\Recertifications.xls")

        DoCmd.TransferSpreadsheet acExport, _
                SpreadsheetType:=acSpreadsheetTypeExcel9, _
                TableName:="Recertifications", _
                FileName:="D:\Recertifications.xls", _


    End Function

ANY help to get this working properly would be great!
Reply With Quote
  #2 (permalink)  
Old December 23rd, 2003, 09:45 AM
Registered User
Join Date: Dec 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I fixed my own problem by doing the export a different way. I used an event procedure on a form called Month:

DoCmd.OutputTo acQuery, "qry_month", "MicrosoftExcel(*.xls)", "D:\Recertifications.xls"

However, now I need to filter this data to a particular month the user chooses in a control(Combo26 which lets the user choose a month) on a form (Month).

In qry_month which is getting exported, I created a field called RecertMonth which returns only the month of the expiration date. In the criteria for this field, I used:

I thought this was correct, but I get the following error:

The action or method is invalid because the form or report
isn't bound to a table or query.

I attempted to make the control bound, but that resulted in nothing being exported. Any suggestions on where I am going wrong?
Reply With Quote
  #3 (permalink)  
Old October 29th, 2004, 12:37 AM
Registered User
Join Date: Oct 2004
Location: Bangalroe, Karantaka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I want to exprt data from MS-Access to MS-Excel using Java programming.
Any one can help to do this.


Reply With Quote
  #4 (permalink)  
Old February 10th, 2011, 01:27 AM
Registered User
Join Date: Feb 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I want to introduce one article about how to export data from database to Excel, Word, PDF and so on. It mainly shows us how to use a small tool and provides an address for download the free component, you can read this article on http://www.codeproject.com/KB/cs/Exc...ExportWiz.aspx
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data from datagrid to excel??? twyce C# 3 March 4th, 2010 04:51 AM
help exporting data to excel MarkGT Classic ASP Basics 5 April 29th, 2008 06:13 PM
Exporting Query Data From Access to Excel JimInSouthernCal Access VBA 3 December 21st, 2007 08:34 AM
Exporting data to excel sheet x_ray VB.NET 2002/2003 Basics 0 January 6th, 2006 03:14 PM
Exporting data from a repeater to an Excel sheet see07 ASP.NET 1.x and 2.0 Application Design 7 January 17th, 2005 03:46 PM

All times are GMT -4. The time now is 01:45 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.