Access 2007 acFormatXLS not working

T

tkosel

I have converted an access 2003 application to Access 2007. The following
code used to work.

DoCmd.OutputTo acOutputReport, "JobNumbersRunReport", acFormatXLS,
Me.ExportLocation


Now, I get an error that says "Runtime error 2287" "The format in which you
are attempting to output the current object is not available"

When I leave the format argument blank, it prompts me for a format, of which
excel is not included!

What happened to the Excel format? Did they take it away?
 
T

tkosel

Thanks for the info. Another strike against using access 2007. For the life
of me, I cannot stand when features are taken away! What a stupid move eh?
 
R

Remi Noel

I installed office 2007 under virtual pc
its easy to get rid of it and continue with.... 2002 :))
Stupid is very gently...

Remi
 
T

tkosel

I guess you are right, but don't want to be too opinionated. I too have the
ability to run 2003, but want to try to use 2007 so that I can use the free
Access 2007 run time. I have deployed several applications using it, and my
customers love it. I can save my customers a lot of money if I can
distribute the application with the Access runtime. (However, if the
functionality isn't there, what good is it right?)
 
R

Remi Noel

Hi "tkosel"

Good luck for you and your customers! :))

I am not a programmer and just using the whole thing for private
applications.
(sorry if my english writing is not that good)
My applications are a mixture of free examples i analysed, make changes and
additions so they fit to what i want to use them for.
I think i will have a look what Access runtime is... since some of "my"
applications are not that bad, except I need about 10MB where a programmer
could do it in 1MB :)))
However, they work and I am happy.
At last but not least, the problem is : Office is great and since years we
have to live with what MS dictates...

CU

Remi
 
B

Bob Larson

While that is removed you can still use the Excel COM model to send things
to Excel.

That would be like:

Dim objXL As Object
Dim xlWB As Object
Dim xlWS As Object
Dim rst As DAO.Recordset
Dim fld As Field

Set objXL = CreateObject ("Excel.Application")

Set xlWB = objXL.Workbooks.Add
Set xlWS = xlWB.Worksheets(1)

Set rst = CurrentDb.OpenRecordset("YourQueryForReportHere")

xlWS.Range("A1").Select
' puts in the field names
For Each fld In rst
With objXL.ActiveCell
.Value = fld.Name
.Offset(0,1).Select
End With
Next fld

xlWS.Range("A2").CopyFromRecordset rst

rst.Close

Set rst = Nothing



--

Thanks,

Bob Larson
Access MVP
Administrator, Access World Forums
Utter Access VIP

Free Access Tutorials and Resources: http://www.btabdevelopment.com
 
R

Remi Noel

Hi Bob

Many thanks :))

Remi
Bob Larson said:
While that is removed you can still use the Excel COM model to send things
to Excel.

That would be like:

Dim objXL As Object
Dim xlWB As Object
Dim xlWS As Object
Dim rst As DAO.Recordset
Dim fld As Field

Set objXL = CreateObject ("Excel.Application")

Set xlWB = objXL.Workbooks.Add
Set xlWS = xlWB.Worksheets(1)

Set rst = CurrentDb.OpenRecordset("YourQueryForReportHere")

xlWS.Range("A1").Select
' puts in the field names
For Each fld In rst
With objXL.ActiveCell
.Value = fld.Name
.Offset(0,1).Select
End With
Next fld

xlWS.Range("A2").CopyFromRecordset rst

rst.Close

Set rst = Nothing



--

Thanks,

Bob Larson
Access MVP
Administrator, Access World Forums
Utter Access VIP

Free Access Tutorials and Resources: http://www.btabdevelopment.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top