473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Excel report using old version of MS excel

Shakss2
19
Hello all,

Im displaying a report in excel.

below is my code:

Dim strPath As String
' Current path
strPath = CurrentProject.Path & "\Adhoc_Report.xls"
'New workbook object
Dim sh As Workbook
DoCmd.OutputTo acOutputTable, "test2", acFormatXLS, strPath, 1
'Setting obj
Set sh = CreateObject(strPath)
'sh.ActiveSheet.Cells.EntireColumn.AutoFit
sh.ActiveSheet.Cells.ColumnWidth = 23
sh.ActiveSheet.Cells.EntireRow.AutoFit

The excel workbook is a Microsoft excel 5.0/95 Workbook.
But the system has the 2003 version installed.
cuz of this old version my report has cell limit of 255 only which truncatest the data.

I strongly believe I should be able to specify the version to be used in my code.
help with the code will be grately appreciated.

Thanks
Shaq
Feb 8 '08 #1
6 3689
ADezii
8,834 Expert 8TB
Hello all,

Im displaying a report in excel.

below is my code:

Dim strPath As String
' Current path
strPath = CurrentProject.Path & "\Adhoc_Report.xls"
'New workbook object
Dim sh As Workbook
DoCmd.OutputTo acOutputTable, "test2", acFormatXLS, strPath, 1
'Setting obj
Set sh = CreateObject(strPath)
'sh.ActiveSheet.Cells.EntireColumn.AutoFit
sh.ActiveSheet.Cells.ColumnWidth = 23
sh.ActiveSheet.Cells.EntireRow.AutoFit

The excel workbook is a Microsoft excel 5.0/95 Workbook.
But the system has the 2003 version installed.
cuz of this old version my report has cell limit of 255 only which truncatest the data.

I strongly believe I should be able to specify the version to be used in my code.
help with the code will be grately appreciated.

Thanks
Shaq
Try:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acTable, "Test2", "MicrosoftExcelBiff5(*.xls)", strPath", 1
Feb 12 '08 #2
Shakss2
19
Hey Thanks for that reply...

But im getting the following error if I use this:
Runtime error 429
ActiveX component cant create object

But if I use the below code, it works:
DoCmd.OutputTo acOutputTable, "test2", acFormatXLS, strPath, 1

Below is the complete code:
Dim strPath As String
' Current path
strPath = CurrentProject.Path & "\Adhoc_Report.xls"
' New workbook object
Dim sh As Workbook
DoCmd.OutputTo acOutputTable, "test2", acFormatXLS, strPath, 1
' This gives the above error:
' DoCmd.OutputTo acTable, "test2", "MicrosoftExcelBiff5(*.xls)", "strPath", 1

' Setting obj
Set sh = CreateObject(strPath)
sh.ActiveSheet.Cells.ColumnWidth = 23
sh.ActiveSheet.Cells.EntireRow.AutoFit

Shaq
Feb 13 '08 #3
Shakss2
19
Sorry for the previous post...

It was my mistake...
That seem to work but it is still using the old version 5.
How can i force it to use version 7 or 8...

Below is the complete code:
Dim strPath As String
' Current path
strPath = CurrentProject.Path & "\Adhoc_Report.xls"
' New workbook object
Dim sh As Workbook

DoCmd.OutputTo acTable, "test2", "MicrosoftExcelBiff5(*.xls)", "strPath", 1

' Setting obj
Set sh = CreateObject(strPath)
sh.ActiveSheet.Cells.ColumnWidth = 23
sh.ActiveSheet.Cells.EntireRow.AutoFit

Shaq
Feb 13 '08 #4
Shakss2
19
I also tried:
DoCmd.OutputTo acTable, "test2", "MicrosoftExcelBiff8(*.xls)", "strPath", 1
But it is still using version 5

Shaq
Feb 13 '08 #5
ADezii
8,834 Expert 8TB
I also tried:
DoCmd.OutputTo acTable, "test2", "MicrosoftExcelBiff8(*.xls)", "strPath", 1
But it is still using version 5

Shaq
'I see no reason why this shouldn't work:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acTable, "Test2", "MicrosoftExcelBiff8(*.xls)", strPath, 1
Feb 13 '08 #6
Shakss2
19
Hi...

I did this...n it worked...
DoCmd.OutputTo acTable, "test2", acSpreadsheetTypeExcel9, "strPath", 1

Thanks a lot for ur support

Shaq
Feb 13 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Randy Morrison | last post by:
I have a report created in ASP (not ASP.NET) that uses Response.ContentType="application/vnd.ms-excel" to display the results of a query from SQL Server 2003 formatted as an html table using Excel...
2
by: Ian | last post by:
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: ...
2
by: Anne Sachleben via AccessMonster.com | last post by:
I am using the TransferSpreadsheet function to export a query result to a specific worksheet in an Excel file titled "report". I want the result to be exported to the worksheet titled "facts". ...
9
by: hari krishna | last post by:
hi, I want to send the data from dataset information to Excel through ASP.Net. there will be no XL installed on web server. web server is win 2000 server machine. I am using visual basic code in...
3
by: Ian Dunn | last post by:
I'm simply trying to access an instance of Excel that has been opened manually by the user in order to put a few values in the existing sheet. Here's the code I've tried: Dim oXL As...
2
by: kalaivanan | last post by:
Hi, dis is kalai and i am new to dis group. i am generating excel report in c# .net using microsoft excel 10.0 object library. the micrsoft office version which i am using is 2002. I can very...
2
by: Scott | last post by:
I preview a report and click the button to publish the report to Word or Excel document. It works correctly until today. It produced below error message. Microsoft Office Access can't complete...
5
by: Sport Girl | last post by:
Hi again my great online assistants, just would like to say that i'm testing the script under unix , and after researches on the internet, i have realised that to resolve 500 Internal Server Error,...
15
by: =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= | last post by:
Hi All, We are in the process of Upgrade Excel 2003 (Office 2003) to Excel 2007 (Office 2007) for one of web application. This web application is using Excel (Pivot Table) reports. With Excel...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.