Ошибка named argument not found

Access 2016.
подключаюсь к Excel

Private Sub btnFile_Click()
Dim appExcel As Object
Dim a as range
Dim wbk As Variant 'Excel.Workbook
Dim wks As Variant 'Excel.Worksheet
Set appExcel = CreateObject("Excel.Application")
Set wbk = appExcel.Workbooks.Add
Set wks = wbk.Sheets.Add(After:=wbk.Sheets(wbk.Sheets.Count))
Set wks = wbk.Sheets("Bilans")
With wks
For col = 2 To 5
        Set a = wks.Range("B" & col & ":Y" & col)
       maxValue = appExcel.WorksheetFunction.Max(a)
       avgValue = appExcel.WorksheetFunction.Average(a)
       a.Replace What:=maxValue, _ 
       replacement:=Replace(CDbl(avgValue), ".", ","), LookAt:=xlWhole, _ 
       SearchOrder:=xlByRows, MatchCase:=False
Next col

на моменте a.Replaceполучаю ошибку:
Named argument not found
Как пофиксить?

upd

Private Sub btnFile_Click()
Dim appExcel As Excel.Application
Dim a as range
Dim wbk As Excel.Workbook
Dim wks As Excel.Worksheet
Set appExcel = New Excel.Application
Set wbk = appExcel.Workbooks.Add
Set wks = wbk.Sheets.Add(After:=wbk.Sheets(wbk.Sheets.Count))

на wbk.Sheets.Countошибка Method or data member not found.

Что смущает, так это то что месяц назад база работала.

Permalink

Cannot retrieve contributors at this time

title keywords f1_keywords ms.prod ms.assetid ms.date ms.localizationpriority

Named argument not found (Error 448)

vblr6.chm1000448

vblr6.chm1000448

office

eb98da9e-0f02-3c9f-5800-b7317af2c479

06/08/2017

medium

A named argument may not be used in a procedure invocation unless it appears in the procedure definition. This error has the following cause and solution:

  • You specified a named argument, but the procedure was not defined to accept an argument by that name. Check the spelling of the argument name.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

[!includeSupport and feedback]

Icon Ex Номер ошибки: Ошибка во время выполнения 448
Название ошибки: Named argument not found
Описание ошибки: A named argument may not be used in a procedure invocation unless it appears in the procedure definition.
Разработчик: Microsoft Corporation
Программное обеспечение: Windows Operating System
Относится к: Windows XP, Vista, 7, 8, 10, 11

Сводка «Named argument not found

«Named argument not found» часто называется ошибкой во время выполнения (ошибка). Когда дело доходит до Windows Operating System, инженеры программного обеспечения используют арсенал инструментов, чтобы попытаться сорвать эти ошибки как можно лучше. К сожалению, некоторые критические проблемы, такие как ошибка 448, часто могут быть упущены из виду.

В выпуске последней версии Windows Operating System может возникнуть ошибка, которая гласит: «A named argument may not be used in a procedure invocation unless it appears in the procedure definition.». В случае обнаруженной ошибки 448 клиенты могут сообщить о наличии проблемы Microsoft Corporation по электронной почте или сообщать об ошибках. Команда программирования может использовать эту информацию для поиска и устранения проблемы (разработка обновления). Поэтому, когда вы сталкиваетесь с запросом на обновление Windows Operating System, это обычно связано с тем, что это решение для исправления ошибки 448 и других ошибок.

Когда происходит ошибка 448?

В первый раз, когда вы можете столкнуться с ошибкой среды выполнения Windows Operating System обычно с «Named argument not found» при запуске программы. Проанализируем некоторые из наиболее распространенных причин ошибок ошибки 448 во время выполнения:

Ошибка 448 Crash — это очень популярная ошибка выполнения ошибки 448, которая приводит к завершению работы всей программы. Это возникает, когда Windows Operating System не реагирует на ввод должным образом или не знает, какой вывод требуется взамен.

«Named argument not found» Утечка памяти — Ошибка 448 утечка памяти происходит и предоставляет Windows Operating System в качестве виновника, перетаскивая производительность вашего ПК. Потенциальные триггеры могут быть «бесконечным циклом», или когда программа выполняет «цикл» или повторение снова и снова.

Ошибка 448 Logic Error — Вы можете столкнуться с логической ошибкой, когда программа дает неправильные результаты, даже если пользователь указывает правильное значение. Неисправный исходный код Microsoft Corporation может привести к этим проблемам с обработкой ввода.

В большинстве случаев проблемы с файлами Named argument not found связаны с отсутствием или повреждением файла связанного Windows Operating System вредоносным ПО или вирусом. Обычно, установка новой версии файла Microsoft Corporation позволяет устранить проблему, из-за которой возникает ошибка. В качестве последней меры мы рекомендуем использовать очиститель реестра для исправления всех недопустимых Named argument not found, расширений файлов Microsoft Corporation и других ссылок на пути к файлам, по причине которых может возникать сообщение об ошибке.

Распространенные проблемы Named argument not found

Типичные ошибки Named argument not found, возникающие в Windows Operating System для Windows:

  • «Ошибка Named argument not found. «
  • «Недопустимый файл Named argument not found. «
  • «Извините, Named argument not found столкнулся с проблемой. «
  • «Named argument not found не может быть найден. «
  • «Named argument not found не найден.»
  • «Ошибка запуска программы: Named argument not found.»
  • «Файл Named argument not found не запущен.»
  • «Named argument not found выйти. «
  • «Неверный путь к программе: Named argument not found. «

Проблемы Windows Operating System Named argument not found возникают при установке, во время работы программного обеспечения, связанного с Named argument not found, во время завершения работы или запуска или менее вероятно во время обновления операционной системы. Запись ошибок Named argument not found внутри Windows Operating System имеет решающее значение для обнаружения неисправностей электронной Windows и ретрансляции обратно в Microsoft Corporation для параметров ремонта.

Истоки проблем Named argument not found

Эти проблемы Named argument not found создаются отсутствующими или поврежденными файлами Named argument not found, недопустимыми записями реестра Windows Operating System или вредоносным программным обеспечением.

В частности, проблемы с Named argument not found, вызванные:

  • Недопустимая или поврежденная запись Named argument not found.
  • Файл Named argument not found поврежден от вирусной инфекции.
  • Другая программа (не связанная с Windows Operating System) удалила Named argument not found злонамеренно или по ошибке.
  • Другая программа, конфликтующая с Named argument not found или другой общей ссылкой Windows Operating System.
  • Поврежденная загрузка или неполная установка программного обеспечения Windows Operating System.

Продукт Solvusoft

Загрузка
WinThruster 2023 — Проверьте свой компьютер на наличие ошибок.

Совместима с Windows 2000, XP, Vista, 7, 8, 10 и 11

Установить необязательные продукты — WinThruster (Solvusoft) | Лицензия | Политика защиты личных сведений | Условия | Удаление

Chris


  • #1

I wrote a fairly elaborate spreadsheet with macros
throughtout. It was written in Excel 2002 v10.4524.4219
SP-2. I have transferred it to the other users in our
office running Excel 2000 v9.0.6926 SP-3. We are
seeing «Compile Error» «Named argument Not Found» when
try to run the macros. The debugger stops
on «DataOption1:=». Please tell me if any steps are
available to fix this without having to rewrite the
spreadsheet in a lower version and Where I can find the
proper syntax for other errors that may occur after this
one is fixed. Many thanks

Chris C.

Advertisements

Chip Pearson


  • #2

Chris,

Post the line of code that is causing the error.

Rob Bovey


  • #3

Hi Chris,

The only way to make this work reliably is to always do your final
compile and save in the earliest version of Excel that you plan to run your
program under. There were a number of Excel methods that were updated with
additional arguments between Excel 2000 and Excel 2002. If you don’t
recognize the argument that’s causing the problem and what it does, then
it’s typically safe to assume that you can simply remove it. This will
eliminate the problem in Excel 2000 and that argument will simply assume its
default behavior in Excel 2002 (which is compatible with Excel 2000 in all
cases that I’ve come across).


Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *

Chris


  • #4

Chip,

Here it is. It hangs on the sort when it hits the
DataOption1:= please note that everything works like a
charm in Excel 2002.

Range(«=Offset(I4,,,CountA(I:I),-9)»).Sort Key1:=Range
(«A4»), Order1:=xlAscending, Key2:=Range _
(«B4»), Order2:=xlAscending, Key3:=Range(«H4»),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

Thanks for looking.
Chris

Chip Pearson


  • #5

Chris,

The DataOption arguments were added in Excel 2002, so they won’t work in
Excel 2000. Omit the arguments.

Chris


  • #6

Chip,

Thanks, it fixed that one but now it stops on
PrintQuality = 600 which may be unique to the print
setup. If so, how can I make this work universally.

The other hang up is on the line:
..PrintErrors = xlPrintErrorsDisplayed
But if delete it everything goes okay. The one I can’t
get is how to make the PrintQuality a universal setting.

My whole routine is as follows:
Sub Print_Man_Hours_by_Division_Report()

‘ Print_Man_Hours_by_Division_Report Macro
‘ Macro recorded 9/4/2003 by J. Christopher Cantele

‘ Make sure the TimeSheet Sheet is active
Sheets(«TimeSheet»).Activate

Range(«A4»).Select
Selection.RemoveSubtotal
Range(«=Offset(I4,,,CountA(I:I),-9)»).Sort Key1:=Range
(«F4»), Order1:=xlAscending, Key2:=Range _
(«H4»), Order2:=xlAscending, Key3:=Range(«B4»),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1,
MatchCase:=False, Orientation:= _
xlTopToBottom
Selection.Subtotal GroupBy:=6, Function:=xlSum,
TotalList:=Array(9), _
Replace:=True, PageBreaks:=False,
SummaryBelowData:=True
‘Set up Page
Range(«A4»).Select
With ActiveSheet.PageSetup
.PrintTitleRows = «$1:$3»
.PrintTitleColumns = «»
End With
ActiveSheet.PageSetup.PrintArea = «»
With ActiveSheet.PageSetup
.LeftHeader = «»
.CenterHeader = _
«&»»Times New Roman,Bold»»&16QCI Marine Offshore
Man Hours by Division&»»Times New Roman,Regular»»&10″ &
Chr(10) & «»
.RightHeader = «»
.LeftFooter = «&D»
.CenterFooter = «Page &P of &N»
.RightFooter = «»
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.57)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.25)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 78
.PrintErrors = xlPrintErrorsDisplayed
End With

ActiveSheet.PageSetup.PrintArea = «=Offset(I1,,,CountA
(I:I),-9)»
ActiveSheet.PrintPreview

End Sub

Advertisements

Rob Bovey


  • #7

Hi Chris,

The PrintQuality setting has been around for a long time, so that one is
not an Excel version problem. However, some printers don’t support this
setting, so that may be the problem you’re running into. Since 600 is the
default value for this property, it looks to me like you can remove this
setting as well without any problems.


Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *

Advertisements

Dave Peterson


  • #8

If you’re not changing something in that print setup portion, comment it out (or
just delete it).

It’ll make your macro a little faster (since it does less), too.

  • #1

Ok, this code works fine:

Code:

detailsSheet.Cells.Copy
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues

But conscious that using Selection can be slower, I tried:

Code:

detailsSheet.Cells.Copy
detailsSheet.PasteSpecial Paste:=xlPasteValues

This gives me a compile error, «named argument not found».

(details.Sheet is set elsewhere, on a user form, as a worksheet)

Also posted here:

http://www.ozgrid.com/forum/showthread.php?t=200128&p=772398#post772398

Last edited: Jun 13, 2016

What is the shortcut key for Format Selection?

Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

  • #2

detailsSheet.Cells.Copy
detailsSheet.Cells.PasteSpecial Paste:=xlPasteValues

  • #3

Hmm, seem to have solved it with:

Code:

detailsSheet.Range("A1").PasteSpecial Paste:=xlPasteValues

Could someone explain why this works but:

Code:

detailsSheet.PasteSpecial Paste:=xlPasteValues

doesn’t? Thanks

GTO

MrExcel MVP


  • #4

Greetings:

Look at help topics for Range.PasteSpecial Method and Worksheet.PasteSpecial Method. You will see that there is no ‘Paste:=’ parameter for the worksheet method.

Hope that helps,

Mark

  • #5

Try this:

Code:

Sub Remove_Formulas()

With Sheets("detailsSheet").UsedRange
        .Value = .Value
    End With
End Sub

MARK858

Понравилась статья? Поделить с друзьями:
  • Ошибка n20 на стиральной машине indesit
  • Ошибка n20 на стиральной машине hotpoint ariston
  • Ошибка n20 в стиральной машине аристон
  • Ошибка n102006 guns of glory
  • Ошибка n1 12 доступа к файлу конфигурации профиля diopost