Run-Time 3027 Cannot update. Database or object is read-only.

ARW17

Board Regular
Joined
Oct 31, 2016
Messages
109
I'm trying to export the results of a query (ENTRY_TINITIALS) to an Excel workbook (Entry_Staff.xlsx) where I'll then use another tab in the Excel workbook to format the data.

I have a button with this code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "ENTRY_TINITIALS", "K:\AUR Office Databases\Office Performance Database\Analyst\Entry_Staff.xlsx!Sheet1"

But I'm getting this error:
1605801576414.png


I thought it might be a Reference issue? Here's what I have checked:
1605801679992.png
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
What kind of query is "ENTRY_TINITIALS"?
Is it a Select query or an Action query?
Does it prompt for parameters?

Is "K:\AUR Office Databases\Office Performance Database\Analyst\Entry_Staff.xlsx!Sheet1" an existing file, or a new file that you are creating?
Did you verify that the path is good (that you have a K drive mapped, and the file path is correct with no typos)?
 
Upvote 0
ENTRY_TINITIALS is a select query. It does not prompt for parameters.

Looks like it doesn't want the !Sheet1 ending of the path, which works for me.
 
Upvote 0
Solution
Looks like it doesn't want the !Sheet1 ending of the path, which works for me.
Yes, that is why I was asking if you are trying to write to an existing file or create a new one.
If creating a new one, you do not need to specify the sheet name.
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,322
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top