Subscript out of range ошибка при импорте

Sometimes the users face the error of subscript out of range in access. This error occurs when you trying to reference an index for a collection that is invalid. Most likely, the index in Windows doesn’t actually include .xls. The index for the windows should be as same as the name of the displayed workbook in the title bar of Excel. Well, there can be many other reasons for subscript out of range access import error.

Reasons Behind Subscript Out of Range Error

The possible reasons for this error are given below: 

  • In the Excel spreadsheet presence of an excessive number of columns.
  • There can be some corruption issues that occurred in Excel files.
  • Access is unable to translate the formatted or calculated Excel fields.
  • While using the disabled Macros to access Excel.

These are the reasons responsible for the error. Now, let’s forward to the methods to resolve this issue.

Methods to Fix Error of Subscript Out of Range in Access

Subscript Out of Range Error is not a big issue that requires so much professional knowledge to fix. Generally, it occurs because of silly mistakes. Review all the given below checklist for fixing the error by making a few adjustment settings.

Method#1: Don’t Put Anything Over the Limit

Firstly, check out how many numbers of columns are present in your Excel spreadsheet? It’s necessary because MS Access Table can not consist of more than 255 number of files.

The best option to resolve this error or Subscript Out of Range Access import by reducing the unwanted column numbers. Only keep those columns that contain important data or the primary key.

The second step is that you can use is splitting the Access database

Method#2: Remove the Calculated Columns

If your Excel workbook consists of any calculated column and you are transferring it Access directly. Then it may create Subscript Out of Range Error. As it’s found that the Access database fails in transferring the formatted or calculated Excel fields.

So, for this, you have to copy the calculated column. After then only paste the calculated column’s value into a new column. At last, delete the calculated column.

Method#3: Make Your Access or Excel Error Free

Just make a quick move over complete your Excel spreadsheet, so that no error will found in your Excel workbook. It can help you to resolve the subscript out of range in access error.

It’s necessary to check because if you are importing an error in an Excel spreadsheet into Access, then it will harm your Excel database. As a result, you will get an error of subscript out of range in the access. So it’s better to go for a regular check.

The same rule of making the Access database error fee is also applicable if you are facing the error while splitting the Access database.

Method#4: Enable Your Disabled Macros

The steps are below for enabling and disabling Macros in all MS Office files.

When you open a file that shows the error of disabled macro then at the top bar, you will a yellow message bar along with the enable content button.

Here are the steps to enable it and fix the subscript out of range access import

  • Firstly, tap on the file.
  • Now, go to the security warnings section and click on the enable content.
  • Select advanced options.
  • A dialog box of MS Office security options will pop-up. From this, choose the option of enable content for this session, for each of the Macros.
  • At last, click on OK.

Method#5: Professional Method

There is an alternative solution to fix the subscript out of range in access error. This contains a third-party tool that you can try. There is professional third-party software i.e, Access Database Recovery Tool. It can easily repair the subscript out of range import issue easily. It comes with some advanced features which are given below:

Features

  • It can easily repair corrupt of MDB and ACCDB files.
  • Also resolves the head corruption and the data misalignment issues.
  • Have the tendency to restore, OLE, MEMO, & BLOB data of MS Access.
  • Supports all Windows OS edition.
Wrap Up

If you have gone through the above post sincerely, then you have got a perfect idea to fix the error. Now, you can work according to these methods and can fix the subscript out of range in access error. As we have discussed the different methods. If we talk about the best, then you can opt for the Access Database Recovery Tool. This can easily fix this error without any consequences. The other methods contain many limitations and also consumes time. So choose the best for a better experience.

Related Post

  • Remove From My Forums
  • Question

  • I’ve created two identical tables in two different databases.  The one gets no subscript errors, the other does.  I’ve triple checked that all the field names and properties are IDENTICAL.  Are there any other factors that would be causing
    the subscript error?

Answers

  • Hi W85,

    Can you make sure that the following suggestions? 

    1. The data type in the Excel sheet columns correspond to the data types in the Access table

    2. You may want to make sure Excel sheet has no hidden columns or rows. Others have ever encountered a such a problem with one Excel sheet that gave a «subscript out of
    range» message.

    As for the problem, please try to highlight all columns and then select the command to «unhide columns» in the format menu. Although I had no hidden columns, this command
    itself was sufficient for the Excel sheet to adjust itself and allow it to be imported into Access. It seems that Access is very sensitive to certain formatting situations in Excel that prevent Excel tables from being imported. 

     Hope this can help you to resolve the problem.If your problem persists, just
    let me know, I will try to help you.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by

      Friday, July 8, 2011 11:29 AM

This write-up contains some effective workarounds to fix subscript out of range Access along with the major reasons behind this error. Also, it describes the best Access Repair Tool to repair the corrupt Access database file & restore the database to its original form.

Thus, if you are facing the below-shown error while splitting the Access database or trying to reference index for the collection that’s invalid, read this post till the end.

Subscript Out Of Range Access

Rated Excellent on Trustpilot
Free MS Access Database Repair Tool
Repair corrupt MDB and ACCDB database files and recover deleted database tables, queries, indexes and records easily. Try Now!

Download
By clicking the button above and installing Stellar Repair for Access (14.8 MB), I acknowledge that I have read and agree to the End User License Agreement and Privacy Policy of this site.

Quick Fixes:

  • Don’t Put Anything Over The Limit
  • Remove The Calculated Columns
  • Make Your Excel or Access Error-Free First
  • Check The Macros Programming Or VBA Coding
  • Enable Your Disabled Macro
  • Repair Access Database Corruption

But before proceeding further, let’s take a look at one of the real user scenarios.

User’s Scenario:

So I’m trying to reset my database.

So I exported most of the tables. Then I saved the database as a template and created a new database based on the template. When I try to import the (exported) tables back in, some of the tables imported in with no issue, but some of them failed with the “Subscript Out of Range” error. Given that I had not made any changes to the exported tables, why can’t it be imported back in? Did I miss out something?

Source: AccessWord-Forums.Com

What Does Subscript Out of Range Mean in Access?

The error “Subscript Out of Range” occurs when attempting to import the Excel database to MS Access database or when you try to split the Access database. Besides, you can also receive this error when you try to reference the index for a collection that’s invalid. However, this error mainly triggers due to the following reasons:

  1. Presence of an excessive number of columns.
  2. Using the disabled Macros of Excel in Access
  3. Access is not able to translate the calculated/formatted Excel fields.
  4. Using the tool wizards while designing queries or any other objects.

Now, let’s check out the below list to fix subscript out of range in Access error using some quick methods.

Subscript Out Of Range Error is not a very big issue that requires so much professional skill to fix. Generally, it occurs due to your silly mistakes in following the criteria of the Excel and Access applications. So, troubleshoot it by making a few adjustments to settings.

Fix 1: Don’t Put Anything Over The Limit

Firstly checks out how many columns are there in your Excel spreadsheet. It’s important because the MS Access table can’t contain more than 255 numbers of fields.

The best option to fix this issue is, by reducing the unwanted number of columns. Only keep the column that contains crucial data or which contains the primary key.

The second step that you can take for this is splitting the Access database.

Fix 2: Remove The Calculated Columns

If your Excel workbook contains any calculated columns and you are directly transferring it on Access then it may generate MS Access subscript out of range error. As it is found that the Access database fails to translate the calculated or formatted Excel fields.

So, for this, you need to copy the calculated column. After then only paste the value of the calculated columns into a new column. At last, delete the calculated column.

Fix 3: Make Your Excel or Access Error-Free First

Just make a quick glance over the complete Excel spreadsheet, so that no error is found in your Excel workbook.

It’s important to check because if you are importing an error containing Excel spreadsheet into Access then obviously it will cause this error in your Access database too. As a result, you will get an Access import subscript out of range on your screen. So it’s better to check…..!

The same rule of making your Access database error-free is also applicable if you are facing the Subscript Out Of Range Error while splitting the Access database.

Fix 4: Check The Macros Programming Or VBA Coding

Well, if you are using any tool wizards; meanwhile macro programming, or when writing some VBA code then check for accuracy. As the chances are very high that a single mistake in coding is generating this Subscript Out Of Range Error.

Sometimes it is seen that query wizard also causes such kinds of issues. It will be better to recreate the query in Access and then manually add all the tables in it.

Well, it’s hard to fetch the exact location where the problem is going on in the VBA coding. All you can do is just make recheck of the entire of your code lines and carefully follow the syntax error.

Areas you have to look at first:

  • If your coding contains an array then make a check over the declared array. Also, see whether it specifies any number of elements or not.
  • If you are using any subscript (!) in your coding then whether the syntax is right or wrong?

So, whether you are using macros or VBA code in Access or Excel go through all your coding either by yourself or you can take the help of any coding expert. You can also check whether your coding is right or wrong by asking about it on any forum site.

Fix 5: Enable Your Disabled Macro to Fix Subscript Out Of Range Access

The steps mentioned below are applicable for enabling and disabling macros in all MS Office files such as Office 365, Office Online, Office 2010, Office 2013, Office 2016.

When you open a file that is showing a disabled macro error then at the top bar you will see a yellow message bar with a shield icon along with the button to enable content.

 Here are the steps to enable it.

  • Tap to the file.
  • Now go to the security warnings section and make tap on the enable content
  • Choose the advanced options
  • A dialog box of Microsoft office security options will appear. From this dialog box choose the enable content for this session option for each of the macros.
  • At last tap the ok.

Subscript Out of Range Access Error

Fix 6: Repair Access Database Corruption 

If the above workarounds fail to solve the MS Access subscript out of range error, it possibly means that your database file is corrupted itself. In such a situation, using Access Repair And Recovery tool can assist you to repair the database inconsistencies & restore its objects like reports, tables, queries, relations, macros, forms, etc.

This program supports Office 365, Access 2019, 2016, 2013, & earlier versions. Besides, it has other outstanding features like:

  • Repairs the split Access db & linked tables.
  • Repair & recover severely corrupted .ACCDB & .MDB files.
  • Offers the option in order to recover password-protected modules and forms.
  • It supports Windows 11, 10, 8, 7, Vista, 2003, & XP.

* By clicking the Download button above and installing Stellar Repair for Access (14.8 MB), I acknowledge that I have read and agree to the End User License Agreement and Privacy Policy of this site.

So, just download & install this software on your PC to repair your corrupt Access DB file and fix the error.

How to use this software:

access-repair-main-screen

access-repairing-completed

previous arrow

next arrow

Wrap Up:

If you have sincerely gone through the above post then you must have got a clear idea of the error source. Now you can work according to that and can fix subscript out of range Access on your own.

Please note, there are still many possible causes of Subscript Out of Range in Access error. I have listed down only the selective ones. So, if any of you guys know more reasons or fixes regarding this error then share them with us on our official TwitterFacebook pages.

tip Still having issues? Fix them with this Access repair tool:

This software repairs & restores all ACCDB/MDB objects including tables, reports, queries, records, forms, and indexes along with modules, macros, and other stuffs effectively.

  1. Download Stellar Repair for Access rated Great on Cnet (download starts on this page).
  2. Click Browse and Search option to locate corrupt Access database.
  3. Click Repair button to repair & preview the database objects.

Pearson Willey is a website content writer and long-form content planner. Besides this, he is also an avid reader. Thus he knows very well how to write an engaging content for readers. Writing is like a growing edge for him. He loves exploring his knowledge on MS Access & sharing tech blogs.

  • Remove From My Forums
  • Question

  • I’ve created two identical tables in two different databases.  The one gets no subscript errors, the other does.  I’ve triple checked that all the field names and properties are IDENTICAL.  Are there any other factors that would be causing
    the subscript error?

Answers

  • Hi W85,

    Can you make sure that the following suggestions? 

    1. The data type in the Excel sheet columns correspond to the data types in the Access table

    2. You may want to make sure Excel sheet has no hidden columns or rows. Others have ever encountered a such a problem with one Excel sheet that gave a «subscript out of
    range» message.

    As for the problem, please try to highlight all columns and then select the command to «unhide columns» in the format menu. Although I had no hidden columns, this command
    itself was sufficient for the Excel sheet to adjust itself and allow it to be imported into Access. It seems that Access is very sensitive to certain formatting situations in Excel that prevent Excel tables from being imported. 

     Hope this can help you to resolve the problem.If your problem persists, just
    let me know, I will try to help you.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by

      Friday, July 8, 2011 11:29 AM

How to Fix MS Access Subscript Out of Range Error

How to Fix MS Access Subscript Out of Range Error

Ms Access Subscript Out of Range error often occurred when you try to import Ms Excel database to Ms Access or trying to split the database. The possible cause of subscript out of range error:
1. Too many column in Excel spreadsheet
2. Corruption in Excel file.
3. Access cannot translate the formatted or modified Excel fields.
4. Disabled Macros from Excel to Access.
5. Using tool wizards in creating query or other objects.
6. Error code in VBA code or Macros programming.
(Sample of the Subscript error when importing database)

Ms Access Subscript Out Of Range (1)

Ms Access Subscript Out Of Range (1)

The solutions for solving the Subscript Out of Range error may be vary depends on the error source. Here are some way to resolve it based on the problem:

1. For Too many Excel Column, the best way to fix it is by reduce the column amount. Just save the crucial, important, or the primary key fields. Or, you can split the database into several databases.

2. For corrupted file, try the repair tools in Ms. Excel. Make sure to back up the spreadsheet first.

3. In the modified Excel fields, you need to remove the format or modified value and convert them into the simplest format. If the field is equation field (summarized, or other calculation) or has formula (like If else), try to not import them and recreate the said fields in the Access instead with Access syntax.

4. For Disabled Macros, you will receive a pop up or warning to inform you. You only have to enable it.

5. The query wizard can cause the problem. Try to create the query and add the tables manually.

Ms Access Subscript Out Of Range (2)

Ms Access Subscript Out Of Range (2)

6. So far, the error caused by Error code in the VBA code is the worse and harder to fix. You need to recheck all of the code lines to find the error, typos, or wrong syntax. Make sure you can answer these following question:
a. Check the declared array. Is the array exist? Do you specify the number of elements?
b. If you using subscript (!), does the syntax is right?

The tutorial above covers the most common Subscript Out of Range error. Please note that there still many possible cause and other solutions to solve and fix the problem.

Related Access Database

  • subscript out of range access
  • access subscript out of range
  • access subscript out of range error
  • subscript out of range
  • ms access subscript out of range
  • access error subscript out of range
  • subscript out of range access error
  • ms access subscript out of range import error
  • subscript out of range error
  • subscript out of range access import

Понравилась статья? Поделить с друзьями:
  • Subscript out of range vba excel ошибка
  • Subscript out of bounds ошибка
  • Subaru impreza ошибка p2109
  • Sub or function not defined vba excel ошибка
  • Subor гироскутер ошибки