Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Use VB To Export Access Report To Excel

I have an Msaccess report, I would like to export this report to excel, and setup my margins, my title, fonts, columns, etc..
I would like to use VB in Access to generate this kind of report in Excel.

Please need your help.

Thank you

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Export Access Report To Excel
Goodday Experts

I need to automate the process of exporting the data in an Access report into Excel. I initialy thought of writing a macro, however when I opened the VBA window it said "Project locked: Project Unviewable". This is a project that someone(no longer works for the company) else worked on and I just need to modify it to carry out the above mentioned process.

I am currently using version 2000 of Access and the program was writen in a previous version. However when I try to convert it, the convert menu is disabled.

Is there another way of going about this? I would appreciate any help.

Kind Regards

Help!!! To Export Label In Access Report In Excel
Hi Friends

I am exporting the report in access in to excel sheet by clicking on the export option in the file menu of access report. My problem is that I am unable to export captions which are in the labels.

PLz!!! help me its really really urgent

Thanks in advance


Export Formatted Report Access->Excel
Hi I need to export a fully formatted report from Access to excel using only Access and VBA.

I am familiar with both the transferspreadsheet command and the outputTo command, but from my experience, these do not provide a fully formatted report with headings, subheadings and page and report totals.

Can anyone suggest something that would work?

It's Urgent! How To Export A Report From Access To Excel
I'm searching for a way how to export a complete report from Access to Excel with page-heads an -feet and the data. Please, can anybody help?

Thank you,

Access Report Export To Excel Issue
I got a problem when exporting a report from access to excel.
This report gets data from a very simple query (SELECT * FROM Table), and it got a very simple layout

- Page header:
Contains some static descriptions
- Details:
Some Textboxes on a single line bound to fields from the query.
Some other Textboxes showing the result of formulas.
- Page Footer:
Just a page number and a print date field.
- Report Footer
Some Textboxes showing the SUM() of the fields in the details section.

Now, surprise.
I can export to excel with DoCmd.OutputTo perfectly.

The second step involves the creation of formulas in the report footer section.
In details section I have fields like "=A/B".
In the footer I have fields like "=SUM(A)/SUM(B)".
When I preview the report I get both type of field working.
But in the EXCEL file I can't see the second type.
I tryed some solutions but I still can't see that kind of formula.



Failed To Export The Report, Error In MS Excel Export Format DLL

I have a little problem with Crystal Reports (CR 8) :

I try to export one of my reports from a VB program. When I try to export it in "Comma Separated Values" format everything is ok (except this is not the format I need
). When I try to export it in excel format it works, on some PCs but not on others ?

VB code sample :

rpt.ExportOptions.FormatType = crEFTExcel80Tabular
rpt.ExportOptions.DestinationType = crEDTDiskFile
rpt.ExportOptions.UseReportDateFormat = True
rpt.ExportOptions.UseReportNumberFormat = True
rpt.ExportOptions.DiskFileName = txtExportDirectory.Text & ExportName
rpt.Export False

I tried all the excel formats (crEFTExcel50, crEFTExcel50Tabular, crEFTExcel70 ...) but on some PC's I always get the "Exporting Records" window for a second and then the error "Failed to export the report, Error in MS Excel Export Format DLL".

Can anyone help me out ?
Thanks !

VBA Export MS Access Report As .doc
Hi All,

I am using MS Access 97, and I would like to know the VBA code for exporting a MS Access report as a word document.

Thanks for the help,

Access Report Export
I have built an access database that creates dynamic reports and then sends them automatically via lotus notes. However a customer has pointed out that the letter looses the company logo during transit. I have tested it and it looks as though the image is not exported to the word file with everything else. Does any one know how I can retain the logo on the exported letter (its a image object)

Thanx in advance

Export An Access Report To PDf
I know, wrong forum but someone here will know how to do this.

How do I programmatically export a MS Access 97 report to PDF?

How To Export MS Access Report
Hi all

I have a Microsoft Access report that i want to export to a folder on my harddisk but the problem is, each month, i would like the script to run that will export this report to a folder on my Hard dirve.
each time the report is exported, it should be saved with the user id of the recipient, this process will continue until all the recipients have reports attached to their names . there are about 300 recipients

Pleas help!!! I am new in Macro and VBA


Crystal Report To Excel Export

I realise this is asked a zillionth time already but I'm still having probs and have not found any solution.

I've tried using the export code posted up in previous msges by "MKoslof " but I'm getting a a "Invalid TLV record" error msg as soon as it gets to the line....
Set rep = appl.OpenReport("c:MyTestRpt.rpt", 1)

I've tried searching for this "Invalid TLV record" error and there were a couple ppl that mentioned that it could be caused by my report file being created from a diff version to the Crystal Report I'm currently running. (Crystal Report 8,VB6) I'm not quite sure how to rectify this as no one in the office has the actual Crystal Report program installed as we all use it from VB using the dsr files. I've also tried using the *.dsr file as the parameter but that returns the same error.

If anyone can point me to the right direction it'd be much appreciated!

Sorry for the ignorance as I've only been exposed to VB and Crystal Report for last couple wks for work exp.



How To Export A Data Report To Excel?
how can i export a data report to excel? can anybody help me....?

How To Export Report Of FPSpread To Excel
I am new to vb and in my project
I have used FPSpread of FarPoint in my project to create the report. Spread
version 3.0 has been used.
The report generated in FPspread is displayed properly. But I have two
1. The prinitng on Dot Matrix is not OK and All the colums of Report are not
being dispayed on one page. I have max 17 colums and the no of Row could be
anything between 55 to 80 depending on the Date selected by the User. The
printer paper format usedd by me Legal German (The full 132 col)
2. How to transfer the report to Excel. I tried to use
fpspread.exporttoexcel method but cannot write proper code and i always get
the message object not available,
Please advise
If you need the code please give me your perasonal email ID as I cannot
attach anything with this mail

Export Crystal Report To Excel
Hi All,

I have a crystal report(.rpt file). I need to export that to excel in my vb(6.0) application. Everything works great. The only issue i have is, when i export the file to excel, the Page Header is not getting exported. So the excel has only the data without column names.

Any ideas?

This is what i am doing.

cdlAdHoc.Filter = "*.xls"
strFileName = cdlAdHoc.FileName

    constr = "DSN=" & gDSN & ";"
    constr = constr & "UID=" & gLoginID & ";"
    constr = constr & "PWD=" & gPWD & ";"
    constr = constr & "DATABASE=" & gDatabase & ";"

            ' Here print the report
            frmReports.crReports.Connect = constr
           frmReports.crReports.Destination = crptToFile
           frmReports.crReports.PrintFileType = crEFTExcel80
           frmReports.crReports.PrintFileName = strFileName
        frmReports.crReports.ReportFileName = App.Path & "
           frmReports.crReports.Action = 1

Export Crystal Report 9 To Excel

Plz. Help me to export the crystal report 9 to excel sheet without asking any parameter?

Exporting An Access Table To A New Excel SS And Open Excel File Afetr Export

Can some help me with writing the code to Export a table from Acces into a new excel spreadsheet, then open an instance of excel to view the newly exported table? I can get the file to export but I am having trouble with the code to open Excel, thanks for you help. See code below..

Private Sub Command26_Click()

DoCmd.TransferSpreadsheet transfertype:=acExport, _
        tablename:="newreqtable", _
        FileName:="F:UserdataSelectionData.xls", hasfieldnames:=True, _
MsgBox "Export is Complete", vbOKOnly, "Selection Data Export"

MsgBox "Your new file is located on F:UserdataSelectionData.xls", vbOKOnly, "Data Export Location"

'This is where I need to have excel open the file for the client.

End Sub

Export Access Report To Word
Is there a way to programmatically export an Access report to Word (that is, to a ".doc" file)? If so, could someone show me how this is done? Thanks in advance!!!

Export Access Report To Word
is there a way to bring an image from my access report onto my word document when i export it?

it's important that i have the company logo on the word document

Export Access Report To Snapshot
I'm trying to use output method to export an active report to local disc, and I receive the following error message:

error number: 2487
The Object Type argument for the action or method is blank or invalid,

Can you let me know what is my mistake in my following code?

Private Sub Report_Open(Cancel As Integer)
DoCmd.OutputTo acOutputReport, , "Snapshot Format", "c:" & Me.Name & ".snp"
End Sub

Best regards
Michael Sakellis

Michael Sakellis

[Access] Export A Report To Jpg File
someone know how to do it?



Crystal Report 8. Export To Excel File
Hi! Good Morning!

I am Tan.

I am using crystal report 8.
In the icon like envelop. I can't export out the report in Ms Excel. I can export to PDF, text and etc. Just cant found the Ms Excel.

Same program, i have install to 2 PCs. Only one of the pc facing this problem. What should i do now?

When i install the program, i also copy
egsvr32 crviewer.dll
egsvr32 Crystl32.OCX
egsvr32 crpe32.dll
egsvr32 craxddrt.dll
egsvr32 craxdrt.dll
egsvr32 craxdui.dll
egsvr32 cpeaut32.dll
to the 2 PCs.

Please help me!


p/s : I am very sorry that i have to post in classic visual basic. Because not reply in crystal forum.

How To Export Data Report In Excel Sheet

I am using datareports to generate the reports in VB. I want to transfer datareports to excel sheet. Please let me know the code to transfer datareports in excel sheet.


How To Export Data To Excel From Cryastal Report
Hi all,

I want to export the data from crystal report to excel.
so i want to give one button , instead of using export
functionality in crystal report....
the same functionality i want to use ....just user clicks
on has to store in the excel file in a specified formate...
let me know the code ....vb code


To Export Crystal Report In Excel Format
Hello friends,

I made an application in vb 6 to generate crystal reports but i don't want to use export button of crystal report and want to add my code in vb which will automatically convert it into excel or pdf format. Also if possible it shld automatically send mail to my id without using outlook express....

waiting for responses,

How To Export Crystal Report In Excel File Using Vb 6.0

I want to write a code in vb which will directly export crytal report into excel or pdf format.... Also tell me which components should i use?

thnx in advance,

Export MS Access 2002 Parameter Report Using VB6
Can some one help me to export MS Access 2002 parameter report using VB6.

I have created parameter report in Access now i want to export this report using VB6.
if you open report will ask you 2 dates to enter then will print or export.

please help me.

How To Export Crystal Report To An Word And Excel File
hi Everyone,

does anybody know how to export a crystal report to an word(.doc) or excel(.xls) file.

This is really important to me b`cos i have all the reports in crystal reports and i have to mail them, but i couldn`t do this because they are all in crystal report format.

but if I just can export this reports to a word or excel file then i will be able to mail them..

I really appreciate it if anybody can show me how to do this or give any URL relevant to this...

thanx in advance,

How To Export Crystal Report File To Excel 8.0(extended)?
how to export a crystal report file in excel 8.0(extended) format?
i'm using crystal report version 10.
thank you.

Create A Report In Access Backend Then Export It To Word Or PDF
i would like to create reports within my access db backend, then when a user wishes to view, or print the report, it is created "silently" so the user does not see the access report, but instead is given a Word.doc report or a PDF report. is this possible and if so how would i achieve it?

Crystal Report Export To ODBC Access Problem
I have Access97 and was doing an export in my Crystal 7.0 report and received an error. My error says:

Failed to export the report.
[Microsoft][ODBC Microsoft Access Driver] Field 'GF1_' already exists in table [CREXPORT].

In my case, all my data is in the Group Footer 1. My Page header contains all the titles, but just as text objects. The Details section is hidden - only the Group Footer 1 is displayed. I have gotten rid of any duplicate field names. It seems the program is exporting all names as 'GF1_' though. Therefore, what change do you think I can make to eliminate this error?

Thanks for any help...


How Can I Export A Report To Excel File Using The ComponentOne VsReport & VsPrinter ?
How can I export a report to Excel file using the ComponentOne vsReport & vsPrinter ?

Excel Option Doesnt Come In Crystal Report Export Dialog Box
hi everybody i am using vb and access and crystal report for my application.before i had problem of export dialog box not coming.but that problem is solved by adding CRXF_XLS.dll and now the dialogbox is coming but excel option is not coming.i think it is a problem of missing another dll, i have also included u2fxls.dll but then also excel option is not coming so please help me in this regard. tell me which dll to include so that excel option can come.
with regards
thanks in advance

Crystal Report Export To Excel Not Woking From Vb Packege Dan Deploy
When i install packege an deploy in other computer crystal report view and print work fine
but export button not respon and when I use this code :

Dim crRpt As New crView1
crRpt.ExportOptions.FormatType = crEFTExcel80Tabular
crRpt.ExportOptions.DestinationType = crEDTDiskFile
crRpt.ExportOptions.DiskFileName = "C:Test.xls"
crRpt.Export (False)

it show error, its posible to export report without install crystal report in other computer??

Export An Access 2000 Report To Pdf File Using Visual Basic
I use VB 6 and Acrobat 4.
I need to export Access reports to PDF files using VB. I can't use the "Acrobat PDFWriter" because it asks interactively for the file name. There is no way to "export as pdf file" from within Access.
Do you know if an ActiveX exists to do that? Or another idea?

Thanks a lot,

Access Export To Excel
Hi there,

I have an Access database who filter de statements of a table in a subform (that looks like a table) I want to export these into an excelfile... any ideas?
I think than Access 2003 have a command for this buy I don't remeber

Thanks a lot for ur comments

Export From Ms Access .mdb To Excel .csv
how do you export the ms access recordset data into an excel .csv?

and one more thing how do you create a .csv/.mdb file at runtime

Export Access To Excel
I have a Access database which gets updated every month with new records and I need to import those new records to new Excel sheet(should allow the user to type in the name of the Excel sheet) making some calculations.

To start with I wrote some code to import all the data in the Access database table to Excel but I am getting error there itself.

This is the code I have written so far.

Private Sub cmdexport_Click()

Dim strExcelFile As String
Dim strWorksheet As String
Dim strDB As String
Dim strTable As String

Dim Conn As ADODB.Connection
Dim query As String
Set Conn = New ADODB.Connection
Dim certNo As Integer

Conn.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & "certs2.mdb" & ";"

Dim xlobj As Excel.Application
Set xlobj = CreateObject("Excel.Application")
Dim xFile As String
xFile = txtFi2Name.Text


xlobj.ActiveWorkbook.SaveAs FileName:= _
"D:Documents and SettingsuserMy Documentsvb_project_AccessToExcel" + xFile
xlobj.DisplayAlerts = False
xlobj.Visible = True

strExcelFile = "D:Documents and SettingsuserMy Documentsvb_project_AccessToExcel" + xFile
strWorksheet = "Sheet1"

strDB = "D:Documents and SettingsuserMy Documentsvb_project_AccessToExcelcerts2.mdb"
strTable = "allcerts2"

Conn.Execute _
"SELECT name INTO [Excel 8.0;DATABASE=" & strExcelFile & _
"].[" & strWorksheet & "] FROM " & "[" & strTable & "]"

Set Conn = Nothing
xlobj.DisplayAlerts = True
Set xlobj = Nothing

End Sub

When I debugged I am getting error at ther very last step, conn.Execute

The error: "Microsoft database engine couldnot find the object Sheet1. Make sure that object exists and that you spell its name and path correctly.

If I change Sheet1 to Sheet1$ this is the error I am getting,
Sheet$ is not valid name. Make sure that it doesnot include invalid character/punctuation and that it is not too long.

Is my code valid? or do I have to set the sheet before using it?
Please help!

Thanks in advance,

Export Access To Excel In Vb6
Is there a simple way of exporting a table in an access2000 database, to a new excel spreadsheet, from a command button in a vb6 form.
i can see lots of solutions but they all seem complicated. I only need to export and end up with the same field names etc.

Appreciate any help


Export Data From Excel Into Access
Hi everyone, I'm kind of stuck. I found an example of export Excel data into an existing table in Access. I have data in cells C34:O34, just one line that I need to update into an Access table. The table is called "EXP_Exceptions", the database is called: "Exceptions.mdb". The column headers are exactly as they appear in the database. The following code will run sometime with no errors, however the table doesn't update:

Sub UpdateAccess()
Dim myAccess As Access.Application
Set myAccess = CreateObject("Access.Application")

With myAccess
.OpenCurrentDatabase "C:Documents and Settingsdmorri18DesktopExceptions.mdb"
.DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "EXP_Exceptions", _
"C:Documents and Settingsdmorri18DesktopQAAgentChecker.xls", True, "C34:O34"
End With

'Set myAccess = Nothing

End Sub
Other times I do get an error and it'll say: "Field "jpyciak" doesn't exist in destination table 'EXP_Exceptions.' That is a value in cell C34, it's title is right above it in cell C33 which is "CDSID" which is a column in the table.

I'm not sure what I am doing wrong. Does anyone have either a fix for this code, or a better way to export data from Excel into a table in Access??



Access 97 SaveAs Excel Export
I have a query and I want to export the results to Excel. In my query I am combining two columns with a chr(10) seperating them. When I export this to Excel it changes the chr(10) to chr(13). Why is this? Does anyone have this problem?

Export Access Query To Excel
We have an Access 2000 application that uses Docmd.TransferSpreadsheet to export a query to Excel. We use TransferSpreadsheet in several places with no problem. However, one query will not export properly on some PC's but does fine on others even though the data is the same.

The Access code looks like this:
Docmd.TransferSpreadsheet, acExport, acSpreadsheetTypeExcel9, "QueryName", "Path", True

The query is relatively complex involving 6 other queries and 1 table.
All users have recent builds of Office 2000, SR1
All users have NT 4, SP6

The Big Issue:
The export works on all PC's with IE 5.5 or 6, but not with IE 5.0. I had one user get Computer Support to upgrade from IE 5.0 to 5.5 (support couldn't find 6.0???) and the export still didn't work.

I think that the problem is related to IE, but can't prove it.

Any ideas?

Help Me :( {Access To Excel Export Macro}
I am FAR from pro at visual basic.
Here's the problem.. When I export files from Microsoft Excel to Access (2003), the first two rows of the exported file get split up in a table. It'll look something like this:

Buyer Field 2 Buyer Cost Field 4 PO
Code Buyer Pricer Date Date

I need to create a macro that will somehow put all of the headers on the second line and completely delete the first.

Can someone help me?

Export Data From Excel To Access
I read the different answers on the forum, but none help me... explainations :

first, as I have a great number of data on a worksheet on excel , named "Ratings", I created a macro via VB to symplifie, to re-formate datas and also to delete the doublons etc... the result is written automatically ( by the VB macro ) on a second worksheet named "SelectionIsin" ( thus, of course, the numbers of rows and columns are different from the sheet "ratings") . All that is ok. The problem comes after :

I want to export the results of this second sheet ("SelectionIsin") to a table in Access "TblHistorique" according to a certain order. In addition, it must recognize if this data ( by rows ) is already written in the Access table. If not, it paste the data in the table, otherwise nothing is done. I begun my code with :

Private Sub CommandButton2_Click()

Dim db As Database
Dim i As Long
Dim rgDate As Range

Set rgDate = Worksheets("SelectionIsin").Range("A2")
rgDate.Name = "RicDate"

Set db = OpenDatabase("\Asset-swap DeskAsset_swap.mdb", False, False, "MS Access;PWD=asset")

While Worksheets("SelectionIsin").Range("RicDate").Offset(i, 0).Value <> ""

db.Execute (" delete * from tblRatingHistorique where RatingHist_date = #" & Worksheets("SelectionIsin").Cells(i, "A").Value & "# ")

db.Execute "INSERT INTO TblRatingHistorique (RatingHist_date,RatingHist_seniorMoodys,RatingHist_subMoodys) VALUES ('Worksheets("SelectionIsin").Cells(i, "A").Value ','Worksheets("SelectionIsin").Cells(i, "F").Value ')"

i = i + 1



End Sub

I think that all that is wrong... can u help me ? Thx for your help...

Export Access Table To Excel
Does anyone know of ways to export data from MS ACCESS to EXCEL using VB program?
Other than the line by line mode, is there any other ways?

Export Access Table To Excel Using Vb?
This should be simple...

I have created a button on my form that says "Export". Now all i want that button to do is export the data from the products table(access 2000) to an excel spreadsheet using vb code. The easiest way possible.

Export Data From Excel To Access
hi, i'm trying to export data from excel to access. the code:

rs.Open "Table", cn, adOpenKeyset, adLockOptimistic, adCmdTable
rs.Find "Test_Name" & Range("A5").Value

i get an error "application is using arguments that are of the wrong type, out of range, or are in conflict"
i changed,
rs.Find "Test_Name" & Range("A5").Value to
rs.Find "Test_Name" & Range("A5").Text

and still problems.. thanks for your help

Export From Access Table To Excel
I want to export an access table to an excel file.
Help pls.

How Do I Export Data From Access To Excel
hi all...
i have a problem regarding with how to display data from Access to Excel using VB6.

can someone tell me how to export data from Access DB to display in Excel.
I hope somebody can give me some coding how to do that.
i had read one thread this before about macro.can tell me how macro is functioned in order to export data from Access to Excel.

Thanks in advance

Search Access DB From VB, Export To Excel
Ok, this is new to me so hopefully this makes some sense.

What i'm trying to do is search data i have in an Access 97 db ( i can put it into 2003 if needed but from what i've gathered 2003 doesn't work with VB 6) In this data there are transactions made by various people and they put info in 2 fields and i have to search these feilds and verify that the text is the right info. I have a reference sheet (currently in .xls) with the correct text. There's about 10 different types of transactions with about 3 versions of text for each.

I have expierence with MySQL and PHP so Access and VB is new to me, but the data i'm given is in Access and i've been doing VB for a few months now and still a beginner.

I'd like to export all of the "incorrect" transactions to an .xls spreadsheet.

Does anyone have any suggestions/examples of something like this, for where to start?

Thanks in Advance

Copyright 2005-08, All rights reserved