473,765 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make Excel sheet

Ian
I have an Access97 database and I am trying to create an Excel sheet from a
report within this database. I have the following code on the On Click event
of a button on a form:

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

On Error GoTo ErrReport

DoCmd.OutputTo acOutputReport, "SpreadSheetCli entRep",
"microsoftexcel (*.xls)", "", True, ""
Exit_OpenCustRe p_Click:

Exit Sub

ErrReport:

Select Case err

Case 2501 'the open report action was cancelled

Resume Next

Case Else

MsgBox Error$

End Select
Resume Exit_OpenCustRe p_Click

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

When I click the button using Access 97 it works perfectly and produces the
spread sheet, however I also need to use the DB in Access 2000 or XP. When I
convert the database to Access 2000 I get the error message:

"The formats that enable you to output data as a MS Excel file were missing
from the Windows registry"

If I open the same 2000 DB with Access XP and click the button I get the
error message:

"The Format in which you are attempting to output the current object is not
available"

My Access 2000 References are (Version that does NOT work):

VB for Apps

Access 9.0 Object Library

DAO 3.6

MS Visual Basic for applications Extensibility 5.3

My Access 97 References are (Version that does work):

VB for Apps

Access 8.0 Object Library

DAO 3.51

Any help would be appreciated.
Nov 13 '05 #1
2 5691
Hi Ian,

I've written code to output to Excel in an Access 2000 database.
Included this statement:
Public gobjExcel As Excel.Applicati on

which is recognized via reference to Microsoft Excel 10.0 Object Library.

Maybe try adding this reference and see if that improves things for you.

Or have you considered this function (I copied this example from the help
files)
DoCmd.TransferS preadsheet acImport, 3, _
"Employees","C: \Lotus\Newemps. wk3", True, "A1:G12"

HTH -Linda
"Ian" <ia********@ntl world.com> wrote in message
news:kQ******** *******@newsfe3-gui.ntli.net...
I have an Access97 database and I am trying to create an Excel sheet from a report within this database. I have the following code on the On Click event of a button on a form:

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

On Error GoTo ErrReport

DoCmd.OutputTo acOutputReport, "SpreadSheetCli entRep",
"microsoftexcel (*.xls)", "", True, ""
Exit_OpenCustRe p_Click:

Exit Sub

ErrReport:

Select Case err

Case 2501 'the open report action was cancelled

Resume Next

Case Else

MsgBox Error$

End Select
Resume Exit_OpenCustRe p_Click

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

When I click the button using Access 97 it works perfectly and produces the spread sheet, however I also need to use the DB in Access 2000 or XP. When I convert the database to Access 2000 I get the error message:

"The formats that enable you to output data as a MS Excel file were missing from the Windows registry"

If I open the same 2000 DB with Access XP and click the button I get the
error message:

"The Format in which you are attempting to output the current object is not available"

My Access 2000 References are (Version that does NOT work):

VB for Apps

Access 9.0 Object Library

DAO 3.6

MS Visual Basic for applications Extensibility 5.3

My Access 97 References are (Version that does work):

VB for Apps

Access 8.0 Object Library

DAO 3.51

Any help would be appreciated.

Nov 13 '05 #2
Try using
acFormatXLS
instead of
"microsoftexcel (*.xls)

"Ian" <ia********@ntl world.com> wrote in message
news:kQ******** *******@newsfe3-gui.ntli.net...
I have an Access97 database and I am trying to create an Excel sheet from a report within this database. I have the following code on the On Click event of a button on a form:

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

On Error GoTo ErrReport

DoCmd.OutputTo acOutputReport, "SpreadSheetCli entRep",
"microsoftexcel (*.xls)", "", True, ""
Exit_OpenCustRe p_Click:

Exit Sub

ErrReport:

Select Case err

Case 2501 'the open report action was cancelled

Resume Next

Case Else

MsgBox Error$

End Select
Resume Exit_OpenCustRe p_Click

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

When I click the button using Access 97 it works perfectly and produces the spread sheet, however I also need to use the DB in Access 2000 or XP. When I convert the database to Access 2000 I get the error message:

"The formats that enable you to output data as a MS Excel file were missing from the Windows registry"

If I open the same 2000 DB with Access XP and click the button I get the
error message:

"The Format in which you are attempting to output the current object is not available"

My Access 2000 References are (Version that does NOT work):

VB for Apps

Access 9.0 Object Library

DAO 3.6

MS Visual Basic for applications Extensibility 5.3

My Access 97 References are (Version that does work):

VB for Apps

Access 8.0 Object Library

DAO 3.51

Any help would be appreciated.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
35560
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
2
5345
by: Niyazi | last post by:
Hi, I have to retrieve a data from AS400 DB2 and after working with data I have to export into one of existing Excel file. I can connect into specific library in AS400 DB2 using AS400 Client-Access v5.2 program using (in VB.NET) ODBC driver (DSN Name …) . I can retrieve datam work on it using VB.NET and I can send into 'NEW' Excel file. My first problem starts here:
12
3225
by: elziko | last post by:
I'm using late binding (I must) to automate Excel. My code opens Excel after createing and poulating some sheets. My problem is that when the user finally decides to close Excel its process is left running until my application closes. I have tried setting my Excel.Application object to Nothing. I have tried to then fore the GC into action using:
3
3761
by: | last post by:
Hello, I have a routine in my Windows application that exports the contents of a datagrid to Excel. It is modeled closely after the HowTo example on MSDN: http://tinyurl.com/5g2jm. Depending on the number of rows/columns in the datagrid, it can be extremely slow (several minutes to populate a 1000x50 spreadsheet). That is understandable, looking at the number of steps to copy over just one row.
3
9925
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that have identical versions of Win XP (SP1) and Excel (SP1) installed. The error is: System.Runtime.InteropServices.COMException(0x800A03EC): Exception from HRESULT: 0x800A03EC. at Microsoft.Office.Interop.Excel._Worksheet.Paste(Object Destination, Object Link) at...
13
2552
by: Niyazi | last post by:
Hi I have a report that I have to run it monthly in my machine. My code in VB.NET and I access AS400 to get data, anaysie it and send into pre formated Excel sheet. The data consist of 9000 rows. I use data table and with for loop I send the data row by row in pre-formated Excel sheet. My machine is:
3
13606
by: implicate_order | last post by:
Greetings, I'm new to python and am in the process of writing a script to parse some CSV data, spread it across multiple Excel worksheets and then generate charts. I searched the internet to find some place where I could look up a HOWTO doc/recipe to do that using either pyExcelerator or win32com.client. Could someone point me in the right direction? I'm at the stage where the spreadsheet and associated data worksheets
3
4845
by: pleaseexplaintome_2 | last post by:
using the code below (some parts not included), I create a new excel workbook with spreadheets. I then want to delete a spreadsheet, but a reference remains open and excel stays in task manager when the code highlighted below is used. can someone help me identify what object remains open and how to release that reference? thanks using Excel = Microsoft.Office.Interop.Excel;
0
1732
by: rajeshkothuru | last post by:
Hi I am new to perl programming, i stcked at one line. I have written code such that new excel sheet will save accordingly even though if already existed Excel sheet persists. The problem is if my new excel sheet has more number of sheets/charts it is not saving properly and it is getting handle to the already existed Excel sheet. If my new excel sheet has only 1 sheet in side it is saving properly. my $Excel =...
2
6414
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the method.... it creates 6 sheets # region Namespaces using System;
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.