Exporting a query into Excel A2003

H

hansjhamm

All,

I have looked thru the questions and answers for this and can't seem to
get this right.

Below is the code:

Private Sub OK_Click()
Me.Visible = True
DoCmd.OpenQuery "ISS Open Position Query", acViewNormal, acEdit
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "ISS
Open Position Query", "C:\Documents and
Settings\Administrator\MyDocuments\ISS Open Position Query", True, ""
DoCmd.Close acForm, "HR Reporting"
But, I get an error message stating ""C:\Documents....." is not a valid
path. I have checked and it is correct.

Ultimately what I want is for the code to create a new Excel file and
not really save it, but open it and leave the saving and where to save
it to the user....plus alot of other things I need done.
But, I can't even get this to save...

Can anyone help me out?

Thanks,

Hans
 
B

Brendan Reynolds

Are you *sure* that path is correct? By default, the user's documents folder
is named 'My Documents', with a space, not 'MyDocuments' without a space.
 
H

hansjhamm

Brendan,

Thanks sometimes we just get TOO close and cannot see what is right in
front of us. You were correct....

Hans
 
B

Brendan Reynolds

I've been in the same situation myself, Hans. Sometimes you just need a
second pair of eyes! :) Happy to have helped.
 

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