RT Error 2587 Can't complete Output operation

I am running the following code:

Dim fd2 As FileDialog
Dim Title2 As String
Dim vrtSelectedItem2 As Variant

Set fd2 = Application.FileDialog(msoFileDialogSaveAs)

With fd2
  .AllowMultiSelect = False
  .Title = "Save File"
  .InitialFileName = "Interiors By Workstream.xls"

     If .Show = True Then
       DoCmd.OutputTo acOutputReport, reportName, acFormatXLS, .SelectedItems(1), True

       MsgBox "No file was selected"
     End If
End With

Open in new window

It was working, now it does this upon an Office 2007 re-install. I had given me the 2587 error saying it can't complete the Output operation..and I have also seen something like format isn't available or soemthing like that.

Also, it doesn't work at all in Runtime. I have been all over EE and I know it is a known bug of sorts. Is there an alternative way to export a report to Excel? Reason I want to do the Report is I have subtotals calculated on the Report and the users like the way it 'was' coming out in Excel upon export.

Any other solutions to this problem will be more than welcomed.

G ScottAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Did I post my DeCompile procedure before ?


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
G ScottAuthor Commented:
you have..I will give it a try.

Stand by.
G ScottAuthor Commented:
I followed this procedure:

1) Compact and Repair the MDB, as follows:
Hold down the Shift key and open the MDB, then from the menu >>Tools>>Database Utilities>>Compact and Repair ...
Close the mdb after the Compact & Repair.
2) Execute the Decompile (See example syntax below) >> after which, your database will reopen.
3) Close the mdb
4) Open the mdb and do a Compact and Repair (#1 above).
5) Close the mdb.
6) Open the mdb:
    a) Right click over a 'blank' area of the database window (container) and select Visual Basic Editor. A new window will open with the title 'Microsoft Visual Basic' ... followed by then name of your MDB.
    b) From the VBA Editor Menu at the top of the window:
        Note ... after the word Compile ...you will see the name of your 'Project' - just an fyi.

7) Close the mdb
8) Compact and Repair one more time.

*** Executing the DeCompile **EXAMPLE**:
Here is an **example** of the command line syntax  (be SURE to adjust your path and file name accordingly) before executing the decompile:

Run this from Start>>Run, enter the following command line - **all on one line** - it may appear like two lines here in the post:
Also, the double quotes are required.

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\Access2003Clients\YourMdbNameHERE.mdb"

Open in new window

And it is still not working.

Not sure if you can take a look : \

It has been working just fine, on the PC I am on now, and on my laptop. Now it doesn't work in either place. Which I find VERY strange. Thanks for taking a look, whenever you get a chance.
G ScottAuthor Commented:
Ok, so after doing a bit of troubleshooting I found something interesting. An older version of this same application works on my laptop. Exports just fine. When I run it on my desktop, it errors out saying it can't do the OutPut.  

My worry is, the end users have RunTime and if I cannot get the export to work correctly then they can't use my DB at all.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.