Vba ошибка 400 - ПК журнал
Polytech-soft.com

ПК журнал
57 просмотров
Рейтинг статьи
1 звезда2 звезды3 звезды4 звезды5 звезд
Загрузка...

Vba ошибка 400

Ошибка 400 в макросе удаления рисунков

Доброго времени суток.

Помогите с проблемой.
Ошибка 400 в макросе удаления рисунков. Сразу не возникала.
Или может другой метод есть удалить рисунок.
Макрос вставляет определенный массив, в котором есть рисунок. При смене данного массива на другой, старый массив убирается, а рисунок, который с ним был остается. Для этого и использую макрос удаления рисунка, а он выполняется, появляется ошибка и начинает глючить excel.

Visual Basic
15.02.2019, 00:47

Ошибка в Макросе
Написал Макрос Sub AfterMarket() ‘Rows(«1:1»).Select ‘Selection.Delete Shift:=xlUp.

Ошибка в макросе
Помогите, пожалуйста, определить ошибку в макросе и исправить ее. Sub ÔÓ() Dim I As.

Ошибка в макросе
Добрый вечер. Подскажите, пожалуйста, как устранить ошибку в макросе. Подключаюсь к базе.

Ошибка в макросе
Добрый день, Подскажите где ошибка в моем макросе

15.02.2019, 10:462
15.02.2019, 12:193
15.02.2019, 14:40 [ТС]4
Вложения

РАСЧЕТ1 чист.zip (128.2 Кб, 9 просмотров)
15.02.2019, 14:44 [ТС]5

Сначала вставляю из выпадающего списка, затем удаляю кнопкой и ОШИБКА 400.

Добавлено через 2 минуты
Пробовал макрос:

Sub МакросУдалР()

‘ МакросУдалР


ActiveSheet.DrawingObjects.Select
Selection.Delete
End Sub

Так он удаляет все рисунки и кнопку макроса тоже.

15.02.2019, 15:536
15.02.2019, 16:167
15.02.2019, 16:16 [ТС]8
15.02.2019, 16:18 [ТС]9

Сразу нет, а потом появляется.

Добавлено через 1 минуту
Макрос очистки ячеек нормально работает, а удаления рисунков нет.

15.02.2019, 16:1810
15.02.2019, 16:25 [ТС]11
Вложения

РАСЧЕТ2 чист.zip (140.1 Кб, 2 просмотров)
15.02.2019, 16:5312

Андрей Лида, открыл, очистил — норма и так раз 20. Вы всё-таки поставьте в МакросУдалРис DoEvents перед End If хуже не будет. В машинах с разной скоростью процессора могут быть ошибки при операциях типа создать удалить шэйп. У меня комп старенький и одна программа прекрасно работала. Отдал пользователю, процессор в разы быстрее и затыкалась. Поставил DoEvents в подозрительных местах — отлично работает и у него.

Добавлено через 2 минуты
ну и где же выпадающие и во второй версии вашего файла?

Как устранить ошибку 400 в excel-vba

Я пишу excel-vba, чтобы найти и удалить всю строку, если есть пустые ячейки в определенном столбце. Мой макрос работает нормально, если есть хотя бы одна пустая ячейка, но показывает ошибку 400, если нет пустой ячейки. Мой код таков

3 Ответа

Вы можете использовать On Error Resume Next , но это обычно не рекомендуется, потому что это может маскировать другие ошибки. Вместо этого попробуйте вычислить n безошибочным способом:

еще один, еще лучший способ-использовать AutoFilter :

Метод, который вы используете «.SpecialCells(xlCellTypeBlanks) » пытается вернуть диапазон. Если нет пустых ячеек, то следующая часть «.cells.count » пытается ничего не считать. Вот почему это дает вам ошибку.

Поскольку вы уже проверяете, если n>0, вы можете просто добавить On Error Resume Next прямо над строкой «n=». Если после этого есть еще код, вы, вероятно, захотите поставить On Error GoTo 0 после этой части, чтобы она не игнорировала последующие ошибки.

Способ 1: Использование OERN (При Ошибке Возобновить Далее)

Способ 2: Использование Автофильтра

Похожие вопросы:

Добрый вечер, Я прочитал предыдущие сообщения и не могу найти ответ на эту конкретную проблему. У меня есть скрипт VBA в excel, который возвращает значения в A2, B2, C2, а затем проходит через цикл.

У меня не так много знаний о VBA. Но у меня есть проблема, которую, я думаю, можно решить с помощью VBA. У меня есть файл PDF из 400 страниц. У меня есть excel с номерами страниц и некоторым.

Я объявил следующую переменную в excel VBA > Dim arrayCollabName as variant > arrayCollabName = Array(Name1,Name2, . Name62) Но имена внутри массива превышают 1 строку в листе VBA и.

следующие две строки Dim curTasks As Tasks Set curTasks = Application.Tasks получить список всех текущих задач и работать как шарм в vba-word но не в vba-excel . есть ли способ перенести его в.

У меня есть проект Excel VBA, который использует MSXML2.XMLHTTP , чтобы принести веб-контент в Excel. Все работает нормально, за исключением того, что иногда я получаю эту ошибку во время выполнения.

im с помощью excel mac 2011. Im пытается получить содержимое в ячейке A2, но это вызывает ошибку. Получение содержимого ячейки A1 работает, но не A2. Я также замечаю, что нет никаких проблем с тем.

Я пытаюсь добавить эту строку кода в vba excel для пользовательской функции (days > 0 ? days + ‘ day’ + (days > 1 ? ‘s’ : ») + ‘ ‘ : ») + hours+’:’+minutes+’:’+Math.round(seconds) Это моя.

Я получаю ошибку несоответствия типа, когда я использую ниже упомянутый код. Если это возможно, пожалуйста, помогите устранить указанную ниже ошибку кода. Как AP#, так и AR3 имеют значения символов.

Я создаю отчет в Excel, и я хотел бы, чтобы VBA форматировал высоту строки на основе значения в столбце K. например, если ячейка K17 = 11.25, я хочу, чтобы строка 17 была 11.25. Ячейка k18 = 21.75.

У меня есть набор документов word, который содержит оценочные формы. Я могу вручную скопировать и вставить их вместе с форматированием в таблицу excel, но мне интересно автоматизировать это с.

Thread: Excel 2016 VBA Error 400

Thread Tools
Display
  • Linear Mode
  • Switch to Hybrid Mode
  • Switch to Threaded Mode

Excel 2016 VBA Error 400

I’m running just a simple batch processing macro to prepare an alternative sheet which will be used for a mass upload into my database. The process is simple, I want the macro to evaluate the string inputed by my analysts and assign variables several set values based off of the input. Using those variables I create the new sheet. Simple enough, unless I get a VBA error code 400 which gives zero explanation as to why/what is the error. Please help, amateur hour needs to end.

Last edited by Paul_Hossler; 03-02-2018 at 11:18 AM . Reason: Added CODE Tags

2. You can use the [#] icon to add CODE tags and put your macro between

3. 400’s are annoying, but if you single step through, does it fail on a line?

4. Can you post a sample workbook with the macro and enough data to show the issue?

————————————————————————————————————————
1. Use [CODE] . [/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] — (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments — Manage Attachments / Add Files / Select Files / Select the file(s)
(multiple files can be selected while holding Ctrl key) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ , especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq. _new_faq_item3

workbook attached.

VBA Example-TESTBOOK.xlsm Attached you’ll find a watered down version of it.It’s throwing a different error now, what are your thoughts

I think that there’s too much .Activate-ing going on

You really don’t need to activate or select things to use or update them

As example, I rearchitected the first part to just use a simple counter loop and just use/update cells directly

Didn’t do the rest, but this will give you the idea

————————————————————————————————————————
1. Use [CODE] . [/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] — (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments — Manage Attachments / Add Files / Select Files / Select the file(s)
(multiple files can be selected while holding Ctrl key) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ , especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq. _new_faq_item3

Regarding the error; take a look at the very bottom of your Weekly_Research sheet. There’s data there which I’m guessing is put there by a previous run of your macro.
The error comes from one of the lines which reads:
ActiveCell.End(xlDown).Activate
putting the activecell at the bottom of the sheet, then when next:
ActiveCell.Offset(1, 0).Activate
gets executed it’s trying to activate a non-existent cell (beyond the bottom of ther sheet). This causes the error.

In the attached is this code which you can run:

It might just do what you want but there are small differences which probably won’t matter. One is if you have a cell with AR: Defective Goods, you’ll see that there is the word Good in there. Your code would skip over this, mine doesn’t.
There some comments within the code.

One thing I’m not sure of is the whether the likes of Packaging Issue , Missing Parts , Copy Issue have to be with one of RH , HR , Co , Im , AR at the start or not. Your existing code suggests not. The problem is that we haven’t got a wide range of possibilities in that column in your sample file.

Last edited by p45cal; 03-03-2018 at 12:25 PM .

Excel File Repair Blog

Get Tips, Tricks and Fixes of MS Excel Issues

[SOLVED] VBA Error “400” Running an Excel Macro

Are you getting an error dialog box titled as Microsoft Excel that contains only number 400? Or getting the error message VBA error 400 Excel 2016, then this article is for you. Here check out the complete information about Excel 2016 macro error 400.

Microsoft Excel is very crucial file and not free from errors. There are many cases seen when many different types of errors crop up and interrupt the users from time to time.

The Excel 2016 error 400 is the one that many users are found reporting. The Excel error 400 is related to the VBA or the Macro. Some users are getting the VBA error 400 while running an Excel Macros.

Despite this, it is also seen it is caused due to improperly configured settings or due to irregular Windows registry entries.

Well, this is very irritating and there is no any exact reason behind what causes the error 400 in Excel.

Here check out some of the possible ones:

Why I am getting Excel VBA Error Code 400:

There is no any exact reason for getting the VBA error 400 Excel 2016, some of the common causes like VBA corruption or the macros you are trying to run is corrupt and many others.

  • Due to incorrect or failed installation or un-installation of software
  • Inval >So these are some of the possible reasons that might cause the VBA error 400 while running Excel Macros.

Now try the possible fixes to resolve the Excel error 400.

How to Fix Excel 2016 Macro 400 Error:

Just like the reasons the solution to resolve the VBA error 400 macros also varies. So here check out the possible solutions like moving the macros to the new module, turning on trusted access to VBA and others to fix the VBA error 400.

Solution 1: Move the Macros to new Module

It might happen due to some kind of external error you are getting the visual basic error 400 in Excel.

So try creating a module in VBA and click on Insert > module and move the macros to the new module. Also, assure deleting the original one.

Hope this resolves the VBA error 400 in Excel macros, if not then try the second possible solution.

You May Also Read:

Solution 2: Turn On Trusted Access to VBA

Sometimes when you are trying to gain access to the VBA project the users starts getting the VBA error 400 in Excel. So here try to turn on trusted access to Visual Basic Projects.

Follow the steps to do so:

  1. Try going to Developer tab. But, if the Developer tab is unavailable, then follow the steps to display it:
    1. First, click File >Options >Customize Ribbon.
    2. Then under Main Tabs > choose the Developer check box.
  2. Now, in the Code group > on the Developer tab > click Macro Security.
  3. And under Developer Macro Settings > choose the Trust access to the VBA project object model checkbox.

Hope turning on the trusted access to VBA fixes the Excel 2016 macro 400 error.

Apart from that also check the codes you are entering as some mistakes in codes may cause the error 400. Also, check for the macros corruption before trying to run them.

Hope the given manual solutions work for you to resolve the VBA error 400 running an Excel Macros. But if not then try the automatic repair utility to resolve the VBA error 400 in Excel.

Automatic Solution: MS Excel Repair Tool

It is recommended to make use of the MS Excel Repair Tool. It is the best tool to repair all sort of issues, corruption, errors in Excel workbooks. This is the best tool that just by scanning once detect and fixes various errors in Excel file and repair and recover damaged, corrupted or even inaccessible Excel file as well. It allows you to easily restore all corrupt Excel file including the charts, worksheet properties cell comments, and other important data. This is a unique tool to repair multiple Excel files at one repair cycle and recovers the entire data in a preferred location. It is easy to use and compatible with both Windows as well as Mac operating system.

Читать еще:  Thunderbird ошибка при сохранении в отправленные
Ссылка на основную публикацию
ВсеИнструменты 220 Вольт
Adblock
detector