Subscript out of range access как исправить

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

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 error access import
  • 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

0 / 0 / 0

Регистрация: 22.01.2017

Сообщений: 4

1

22.01.2017, 16:12. Показов 16020. Ответов 3


Студворк — интернет-сервис помощи студентам

Народ, помогите. Пытаюсь создать отчет:

В окне База данных активизируйте вкладку Отчеты. В этом же окне нажмите кнопку Создать. 30. С помощью Мастера отчетов создайте отчет для вывода данных запроса Приказ. В качестве источника данных используйте запрос Приказ. Выберите для отчета все поля. При создании отчета использовать сортировку по полю Фамилия, вид отчета Табличный, стиль Строгий, сохраните под именем Приказ. Закройте отчет.

Выходит ошибка(см. прикреплен. фото)
Так же приложил саму БД

Миниатюры

Ошибка subscript out of range
 



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

22.01.2017, 16:12

3

Эксперт MS Access

26782 / 14461 / 3192

Регистрация: 28.04.2012

Сообщений: 15,782

22.01.2017, 16:52

2

Лучший ответ Сообщение было отмечено Melitant как решение

Решение

Действительно какой-то баг. И откуда ноги растут осталось неясным. Причем без поля Процент все нормально. Что в нем, в этом поле непонятно. Не помог даже импорт в новую чистую БД.

Сделал иначе. Мастером создал отчет без поля Процент. А потом уже добавил поле в конструкторе. Смотрите вложение, отчет Приказ1.



1



0 / 0 / 0

Регистрация: 22.01.2017

Сообщений: 4

22.01.2017, 16:59

 [ТС]

3

Сам тоже не понял так. спасибо!
p.s. тему можно закрывать.



0



Эксперт MS Access

17203 / 7058 / 1579

Регистрация: 21.06.2012

Сообщений: 13,238

22.01.2017, 17:03

4

По всей видимости не “любит”

иногда

Аксесс одинаковые имена таблиц/полей, проектов/панелей инструментов, … . Здесь имя таблицы и поля в ней группа, заменил имя поля группа на группa (а на латинице).

Не по теме:

Ловкость рук и никакого мошенничества (С)



2



Joe4

Joe4

MrExcel MVP, Junior Admin


  • #2

Welcome to the Board!

Importing Excel files into Access can sometimes be a fickle thing, especially if you are importing to an existing Access table, or there are inconsistencies in your data.
Have a look here, and see if any of the situations mentioned here apply to you: Subscript Out of Range error when importing into Access 2007 from – Microsoft Community

Note that when Access imports Excel files, it generally looks at about the first ten records to determine the format of each field. If something changes after that, it could cause problems. Like let’s say that you have a field that looks numeric, but down on line 100, there is an alpha character in there. That will cause problems.

I have spent hours on some of these imports before. As a last resort, I will export the Excel file to a text file format (CSV, tab-delimited, Fixed-Width, etc), and then import that into Access. The advantage there is you control the Date Types for all the fields you are importing, and it tends to work a little better.

  • #3

I have had the same problem. I tried copying all my Excel data and pasting it as values only into a new worksheet and then made it into a table. That still did not work. Then tried it with CSV as well. Kept returning an error that Field 65 does not exist in my table! Went back to my Excel spreadsheet (to the values sheet) and re-sized all my columns. Saved it and tried importing again into Access. Hehe! Only got “Unparsable Record” errors, but still imported all the data. Well Done Microsoft!! LOL!

  • #4

yes I have had this problem on many occasions, as I import daily many csvs
Personally I think that a macro formatting all columns is the way to go and also make sure that column names are the same
However I have only today just discovered that saving as a “Tab Delimited” csv is the way to go
I also have Vba code to delete Import error tables after the import takes place
Regards
Graham

  • #5

yes I have had this problem on many occasions, as I import daily many csvs
Personally I think that a macro formatting all columns is the way to go and also make sure that column names are the same
However I have only today just discovered that saving as a “Tab Delimited” csv is the way to go
I also have Vba code to delete Import error tables after the import takes place
Regards
Graham

Hi there – I just had the same problem and it turned out that I had an Input Mask for my PostCode field in .accdb and the Excel field wasn’t matching the input mask. I removed the input mask and it imported! Hope that helps someone.

  • #6

Whenever I run into an issue, I import the file into Access as a new table, compare field value types and formats to the existing table. This helps me solve for my import issues.

  • #7

Today, for the first time, I received the ‘subscript out of range’ error while performing an import I have been doing every week for over a year now. Out of frustration, I closed & re-opened Access, tried the import again and was successful. Hope this helps some…

  • #8

Today, for the first time, I received the ‘subscript out of range’ error while performing an import I have been doing every week for over a year now. Out of frustration, I closed & re-opened Access, tried the import again and was successful. Hope this helps some…

Worked like a charm. thank you

  • #9

Hi all,

I am getting pretty fed up with all the hassle I am having just trying to import data from Excel 2007 to Access 2007 so I hope that someone is able to help!

All I want to do is import a spreadsheet from excel to access. I have checked that all the fields and headings and content are correct. i have actually imported this data previously but had to remove it and start again. However now when I use the import data from excel button and follow the wizard through it comes up saying ‘subscript out of range’.
For a start I dont even know what this means and Access helpfully doesn’t tell you. How do I find out, fix it and import data that happily went in before??
Help!

Try importing data as its own table then perform append query to the table you want. It worked for me

Добавить комментарий