# A different company file is open
Source: https://www.desktopaccountingapi.com/docs/help/connection-errors/wrong-company-file/

> Fix error 0x8004040A and a company file mismatch when QuickBooks has a different company file open than the one you connected.

QuickBooks has a company file open, but it is not the file this connection was set up for. QuickBooks opens one company file at a time on each computer, so the app has to wait for its own file.

## What you see

When a different file is open, the app shows:

> A different company file is open in QuickBooks Desktop. Open the company file you connected, then try again.

The app's support team may see the code `0x8004040A`. During setup, the title is "A different company file is open".

A related message means the file at the stored location now belongs to a different company:

> The open company file does not match the one that was connected. Please contact the application provider.

## Why it happens

The first message appears when someone opened another company file in QuickBooks on the connected computer. This is common when:

- one person works in several company files on the same computer
- two company files are connected on the same computer, and the other one is open right now
- someone opened a sample company or a test copy

The second message, a company file mismatch, is a protection. Each connection records which company it was set up with. If the file QuickBooks opens reports a different company, the connection refuses to use it instead of reading or writing the wrong books. That happens when a different company file was saved over the original name or location, or when a copy of another company was put in its place.

Restoring a backup of the same company does not cause a mismatch.

## How to fix it

### A different file is open

1. On the computer that runs the Web Connector, look at the QuickBooks title bar to see which company file is open.
2. Save your work in that file, then close it with **File › Close Company**.
3. Open the company file this connection uses. If you are not sure which one that is, the setup page showed its name next to **Company identified**, and the app's support team can see it too.
4. Try the action in the app again.

If you chose **Yes, always; allow access even if QuickBooks is not running** during setup, you can also close QuickBooks completely. The Web Connector then opens the right file in the background when the app needs it.

### Several connected files on one computer

Two connections on one computer take turns. Requests for the file that is not open fail with this message until that file is opened. For a busy setup, put the files on different computers or arrange the work so the file the app needs is the one left open. See [Connect several company files](https://www.desktopaccountingapi.com/docs/help/guides/multiple-company-files/).

### Company file mismatch

You cannot fix this from QuickBooks alone, because the connection needs to be told which file is correct.

1. Find out what changed. Was a file renamed, replaced, or restored from another company's backup?
2. Put the right company file back at its usual location, if you can. Then open it in QuickBooks on the connected computer.
3. If the right file now lives somewhere else, contact the app's support team. They can reset the stored company file path, and the next session records the new location. See [Fix a moved, renamed or restored company file](https://www.desktopaccountingapi.com/docs/help/guides/moved-or-renamed-file/).
4. If you meant to switch the app to a different company, ask the app for a new setup link for that company.

## How to check it worked

Try the action in the app again. In the Web Connector, the app's row shows no error in **Last Result**. During setup, click **Check again** and confirm the name next to **Company identified** is the company you expect.

## When to contact the app's support

Contact them for any company file mismatch, and for a wrong-file message that appears while the right file is open. Send the time, the exact message, the name and folder of the company file you have open, and a screenshot of the app's row in the Web Connector window.

## Related pages

- [The company file cannot be found](https://www.desktopaccountingapi.com/docs/help/connection-errors/company-file-not-found/)
- [Fix a moved, renamed or restored company file](https://www.desktopaccountingapi.com/docs/help/guides/moved-or-renamed-file/)

The Web Connector sometimes reports this situation as `0x80040408` (could not start QuickBooks), because QuickBooks refuses to open the connected file while another one is open.

For developers, see [`QBD_WRONG_COMPANY_FILE_OPEN`](https://www.desktopaccountingapi.com/docs/errors/#qbd_wrong_company_file_open) and [`QBD_COMPANY_FILE_MISMATCH`](https://www.desktopaccountingapi.com/docs/errors/#qbd_company_file_mismatch).
