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
6 3689
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: -
DoCmd.OutputTo acTable, "Test2", "MicrosoftExcelBiff5(*.xls)", strPath", 1
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
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
I also tried:
DoCmd.OutputTo acTable, "test2", "MicrosoftExcelBiff8(*.xls)", "strPath", 1
But it is still using version 5
Shaq
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: - DoCmd.OutputTo acTable, "Test2", "MicrosoftExcelBiff8(*.xls)", strPath, 1
Hi...
I did this...n it worked...
DoCmd.OutputTo acTable, "test2", acSpreadsheetTypeExcel9, "strPath", 1
Thanks a lot for ur support
Shaq
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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:
...
|
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". ...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
| |