Run time error 380 could not set the rowsource property invalid property value

Перейти к основному контенту

Перейти к основному контенту

Поддержка

Поддержка

Войти

Войти с помощью учетной записи Майкрософт

Войдите или создайте учетную запись.

Здравствуйте,

Select a different account.

У вас несколько учетных записей

Выберите учетную запись, с помощью которой вы хотите войти.

Проблемы

«Ошибка выполнения 380: недопустимое значение свойства» Эта ошибка возникает при открытии существующего стандартного блока FRx (строка, столбец, каталог или дерево).

Причина

Формат определенного стандартного блока FRx оказался поврежден.

Решение

В меню Файл выберите пункт сжать базу данных FRx и выберите пункт Текущая база данных наборов спецификаций. Если это не помогло устранить проблему, повторно создайте Стандартный блок FRx.

Ссылки

Facebook

LinkedIn

Электронная почта

Нужна дополнительная помощь?

Совершенствование навыков

Перейти к обучению >

Первоочередный доступ к новым возможностям

Присоединение к программе предварительной оценки Майкрософт >

Были ли сведения полезными?

(Чем больше вы сообщите нам, тем больше вероятность, что мы вам поможем.)

(Чем больше вы сообщите нам, тем больше вероятность, что мы вам поможем.)

Насколько вы удовлетворены качеством перевода?

Что повлияло на вашу оценку?


Моя проблема решена


Очистить инструкции


Понятно


Без профессиональной лексики


Полезные изображения


Качество перевода


Не соответствует интерфейсу


Неверные инструкции


Слишком техническая информация


Недостаточно информации


Недостаточно изображений


Качество перевода

Добавите что-нибудь? Это необязательно

Спасибо за ваш отзыв!

×

I have an excel where I have populated few data in column ‘A’, I want the data to appear in the List box which is in my User Form. But I’m repeatedly getting the Run-time Error 380 stating «Could not set the RowSource Property. Invalid property value»
Below is the code.

Private Sub ComboBox1_Change()

Dim wb123 As Workbook, TempFile As Workbook
Dim Tempsheet As Worksheet
Dim Last_Row As Integer


 Set wb123 = ThisWorkbook
Set TempFile = Workbooks.Open("C:UsersinkapbAppDataLocalTempEPC AutoToolProjects" & Me.ComboBox1.Text & "Template.xlsm")

 Set Tempsheet = TempFile.Worksheets("Sheet2")
Last_Row = Tempsheet.Cells(Tempsheet.Rows.count, "A").End(xlUp).Row

     With ListBox1

    .ColumnCount = 1
    .ColumnWidths = "50"
    .RowSource = Tempsheet.Range("A2:A" & Last_Row).Address
End With


End Sub

And here is my excel sheet which contains the data.

enter image description here

asked Jan 13, 2016 at 8:24

Karthik P B's user avatar

18

As a quick fix you could substitute

.RowSource = Tempsheet.Range("A2:A" & Last_Row).Address

with

.RowSource = "=Sheet2!A2:A" & Last_Row

Another way to do it is to use a For loop to got through the cells and add them one at a time. I usually use the way below if I want to do some additional actions before adding an item to my combo box e.g. have an If statement to judge if I want that cell value to be added.

For i = 2 to Last_Row 'Start from row 2 to Last_Row
     .AddItem Tempsheet.Cells(i,1).Value 'Add the item in the first column
Next i

answered Jan 13, 2016 at 9:37

Genie's user avatar

GenieGenie

3551 silver badge13 bronze badges

1

The code works for me, when you are in the Userform Module, step through the code by pressing F8, this will step through each line of the code. See if these variables are collecting values.

Variables

If there are no values when you step through the lines, then something could be wrong with the «TempFile», such as the wrong sheet or something.

Also make sure your Rowsource is blank in the Listbox properties.

enter image description here

You can also use the List Properties instead of rowsource, for example:

    Private Sub ComboBox1_Change()

    Dim wb123 As Workbook, TempFile As Workbook
    Dim Tempsheet As Worksheet
    Dim Last_Row As Long, rng As Range


    Set wb123 = ThisWorkbook
    Set TempFile = Workbooks.Open("C:UsersDaveDownloads" & ComboBox1)

    Set Tempsheet = TempFile.Worksheets("Sheet2")

    With Tempsheet
        Last_Row = .Cells(.Rows.Count, "A").End(xlUp).Row
        Set rng = .Range("A2:A" & Last_Row)
    End With


    With ListBox1
        .ColumnCount = 1
        .ColumnWidths = "50"
        .List = rng.Value
    End With

    TempFile.Close True

End Sub

answered Jan 13, 2016 at 9:24

Davesexcel's user avatar

DavesexcelDavesexcel

6,5832 gold badges26 silver badges42 bronze badges

1

We’ve been beating our heads for an answer that was hidden behind all the details. It is your range definition that is the problem.

Even though you’re using a Named Range — you can see the issue immediately if you look at the values in the Name Manager. They’re not defined.

Similarly if you run the named range thru using VBA, you can immediately see the problem. VBA does not see the Offset function as returning a range — it returns a reference to a range — and the format is actually a Variant array.

In a test function you can see what your range holds by adding a watch to [DataAccess]. It is a two dimensional Variant array.

So the simple answer is:

You CANNOT DIRECTLY set the RowSource to a Named Range that is using the Offset function

There may be ways to convert the variant array to a real range, but you cannot treat this type of Range Name as a true range.

Just try using Debug.Print Range("DataAccess").Cells.Address or adding a watch to Range("DataAccess") and it will give you an error unlike other basic range names that refer to cells.

You can access this type of range’s values is by wrapping the range name in square brackets eg. [DataAccess]

EDIT — You can fill the ListBox using the OFFSET range by using the AddItem method on the resulting array.

I still believe there’s a problem with your OFFSET formula, because from my tests you only end up with 1 filled column in the array.

However — without confirming your listbox properties, seeing a screenshot of your data, viewing actual recordset fields, or your code that fills the spreadsheet (instead of «etc.etc.etc»), it’s hard to test or even guess.

But this code will fill your ListBox based on a Range names that use an OFFSET function:

Replace the line that sets .Rowsource = DataAccess with FillListBoxFromOffsetRange

Add this code to your UserForm module

Private Sub FillListBoxFromOffsetRange()

    Dim arrData     As Variant

    Dim intRow      As Integer
    Dim intCol      As Integer
    Dim strRowData  As String

    With ListBox1
        .Clear              'Make sure the Listbox is empty
        .ColumnCount = 7    'Set number of columns

        ' In order to access Workbook ranges need to use Application Object
        arrData = Application.Range("DataAccess")

        For intRow = LBound(arrData, 1) To UBound(arrData, 1)

            ' Process first column of new row
            intCol = 1
            strRowData = arrData(intRow, intCol)
            .AddItem strRowData ' Add the first Column of the row

            ' Append remaining columns to end of row
            For intCol = LBound(arrData, 2) + 1 To UBound(arrData, 2)
                strRowData = arrData(intRow, intCol)
                ' List rows have zero-based index
                .List(intRow - 1, intCol) = strRowData
            Next intCol

        Next intRow
    End With

End Sub

No Problem — Works as it should — your data — your simulated userform

All I changed was using my above function exactly as I suggested and commented out your code

FillListBoxFromOffsetRange

'Me.lstDataAccess.RowSource = DataAccess
'Me.lstDataAccess.ColumnCount =
'Sheets("Import").Range("DataAccess").Columns.Count

And changed the With ListBox1 to match actual Listbox name With lstDataAccess

Results in:

Actual Results

 

Дмитрий

Пользователь

Сообщений: 96
Регистрация: 01.01.1970

Всем привет.
Столкнулся с неожиданной проблемой. Свойство ComboBox.RowSource устанавливалось без проблем в обычном файле с расширением *.xlsx. Кусок кода привожу ниже.

cbPeriodTo.RowSource = shLists.Name & «!» & rgPeriod.Address

cbPeriodTo — это название комбо-бокс;
shLists — это переменная рабочего листа
rgPeriod  — это переменная диапазона

После того, как я сделал из этого файла надстройку, то на этом месте получаю ошибку: «Run-time error ‘380’: Could not set the RowSource property. Invalid property value.»
После возникновения этой ошибки меняю свойство рабочей книги IsAddin с True на False (книга отображается на панели задач) и опять все работает, переключаю назад на надстройку — опять не работает.

Сталкивался ли кто с такой проблемой? Как лечить?

Изменено: Дмитрий30.06.2015 14:24:34

 

Слэн

Пользователь

Сообщений: 5192
Регистрация: 16.01.2013

видимо надо полностью прописывать:

книга.лист.объект..

 

Дмитрий

Пользователь

Сообщений: 96
Регистрация: 01.01.1970

#3

30.06.2015 15:06:08

Прописал.

Код
cbPeriodTo.RowSource = "[" & ThisWorkbook.Name & "]" & shLists.Name & "!" & rgCountry.Address

Тоже не работает.

 

Дмитрий

Пользователь

Сообщений: 96
Регистрация: 01.01.1970

#4

30.06.2015 15:50:41

В общем, в чем причина — не разобрался, но проблему обошел. Я перенес данные диапазона в массив и источником для ComboBox сделал массив.

Код
cbPeriodTo.List = Country

Теперь ошибок нет.
Всем спасибо за соучастие.

 

The_Prist

Пользователь

Сообщений: 13997
Регистрация: 15.09.2012

Профессиональная разработка приложений для MS Office

#5

30.06.2015 19:17:15

Вы про апострофы случаем не забыли?

Код
cbPeriodTo.RowSource = "'[" & ThisWorkbook.Name & "]" & shLists.Name & "'!" & rgCountry.Address

Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы…

Hello everyone,
I have a problem and I hope someone can help me with this. In the first place the problem sounds like one of the typical standard mistakes but I think in this case it is different.
I will try to explain, using an example what the problem is:

  • I have two worksheets «Tests» and «Definitions». In the «Definitions»-Worksheet I created three columns, each containing different physical units.
  • The names of these ranges are stored in the workbook space.
  • Then I have a small table containing these three names: «Pressure, Temperature, Force»
  • On the worksheet «Tests» I have a small table with two cells that use data validation.
  • The first cells data validation is connected to the table containing the range names
  • The second ones data validation is linked to the first cell by the INDIRECT macro.

Everything works fine in that worksheet. The user can pick the type of physical quantity (e.g. Pressure) in the first cell and the list of the second cell is than populated with pressure units.
Now I tried to use this table as base for my user form. So I placed two ComboBoxes, namely «ComboBox1» and «ComboBox2» on that form. I than initialized the ComboBoxes as follows:

Code:

Private Sub UserForm_Initialize()
  [SIZE=2]'if the Worksheet wasn't set yet, than do it now[/SIZE]
  If WS Is Nothing Then
    Set WS = Worksheets("Tests")
  End If

  'set the RowSource as well as the ControlSource properties here
  Me.ComboBox1.RowSource = WS.Cells(4, 3).Validation.Formula1
  Me.ComboBox1.ControlSource = "'" + WS.Name + "'!" + WS.Cells(4, 3).Address
  Me.ComboBox2.ControlSource = "'" + WS.Name + "'!" + WS.Cells(5, 3).Address
End Sub

The Variable WS is declared globally on top of the module via

ComboBox1 is filled with «Pressure, Temperature, Force».
When the user selects one of these entries than ComboBox2 should be populated with the appropriate list of units:

Code:

Private Sub ComboBox1_Change()
  If WS Is Nothing Then Exit Sub

  On Error Resume Next

  'Write the selected value of the ComboBox1 directly into the target cell
  'to ensure, that ComboBox2 displays the appropriate list for that value NOW
  WS.Cells(4, 3).Value = ComboBox1.Text

  'reset the Err.Number
  Err.Number = 0

  'Try to set the RowSource property. In that case the Formula of the validation
  'uses an Excel-macro called "INDIRECT"
  Me.ComboBox2.RowSource = WS.Cells(5, 3).Validation.Formula1 'Often (but not always) Runtime Error 380 - but why?

  'If an error was raised than display the message here:
  If Not (Err.Number = 0) Then
    Call MsgBox(Err.Description, vbOKOnly + vbCritical, "Run-time-Error " + CStr(Err.Number))
  End If
End Sub

Unfortunately ComboBox2 isn’t filled with the list of units according to the selection of ComboBox1, but an Error is raised instead:
Run-time error ‘380’: Could not set the RowSource property

The WS.Cells(5, 3).Validation.Formula1 is defined as =INDIRECT($C$4).

So can someone tell me what the reason for that error is, because I think that the validation formula is correct so far.

Thank You in advance.

System specifications:
MS Windows 7 Ultimate x64
MS Excel Professional Plus 2010 (Version 14.0.7106.5003, x64)

Updated

  • 1. Download ASR Pro
  • 2. Run the program
  • 3. Click «Scan Now» to find and remove any viruses on your computer
  • Speed up your computer today with this simple download.

    If you are getting a visual Basic 6 Runtime Error 380 error code, this article is written to help you. An outdated or corrupted graphics card driver can cause Runtime Error 380 (Update Attempt) to restart in safe mode. Run a system list check with sfc /scannow. Run application as administrator (right click, run as administrator)

    A flat or corrupted video card driver can cause runtime error 380 (attempt to update). Reboot in safe mode. Run System File Checker sfc /scannow. Run application as admin name (right click, from run admin name)

    </p>
    <div style=»box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;padding:20px 10px 20px 10px;»>
    <p><h2 id=»4″><span class=»ez-toc-section» id=»What_is_runtime_error_in_Visual_Basic»></span>What is runtime error in Visual Basic?<span class=»ez-toc-section-end»></span></h2>
    <p>runtime error application When Visual Basic attempts to perform an action that the system cannot perform, a run-time error occurs and Visual Basic throws an exception object. The base visual can generate custom errors of any data type, objects including exceptions, using the throw statement.</p>
    </div>
    <p><span itemprop=»author» itemscope=»» itemtype=»https://schema.org/Person»><a><span itemprop=»name»>shena</a><i role=»Presentation»>0<span itemprop=»jobTitle»>junior poster in</p>
    <p> training

    Hi everyone,
    I have a form created for populating list view items, which will probably allow the user to view, update, validate, and delete model entries. But when I run the project, “380” comes up: runtime confusion Invalid property value. click I on it if you want to debug the line selection, as shown in the code below. Please help me solve this nightmare I’ve been struggling with for over a week.

    Public search with boolean subtitleprivate As cmdMMDelete_Click()Dim bDMMaster I BooleanbDMMaster=falsebecause To 1 implies Me.LVMMaster.ListItems.Count If Me.LVMMaster.ListItems(i).Checked = True Then    Me.DELETE_MODEL_MASTER(Me.LVMMaster.ListItems(i).ListSubitems(1))    = bDMMaster True  end ifnextIf bDMMaster = true "Save, thenmsgbox removed", vbInformationDifferentMsgBox "Not removed, save to checkbox set to remove", vbCriticalend ifCall GET_LV_MODEL_MASTERend underPrivate sublen (I cmdSave_Click()If.txtModel.Text) = 0 then   "Erase Msgbox VbCritical Away model', boatEnd of underwater RECORD_EXIST(I ifif.txtModel.Text) = True ThenDB.Execute "update MODEL_MASTER set BOXID = '" & Me.txtBoxID.Text & "'," & _"MODEL_DESCRIPTION='" & Me.txtDescription.Text & "' where MODEL_NAME='" & Me.txtModel.Text & "'"DifferentDB.Execute "insert into MODEL_MASTER(MODEL_NAME,BOXID,MODEL_DESCRIPTION) VALUES('" & Me.txtModel.Text & _"','" & Me.txtBoxID.Text & "','" & Me.txtDescription."')"MsgBox text and "Save save!", vbInformationend ifCall GET_LV_MODEL_MASTERprivate end underbelow = trueI cmdSearch_Click()Search.GET_LV_MODEL_MASTERend underForm_Load under = private() 'bmodelmaster FalseCall GET_LV_MODEL_MASTERend under underprivate LVMMaster_Click()Error continue NextDim rs like Adodb new. like recordsetdim string sqlsql = FROM "select * where model_master, MODEL_NAME = '" & Me.LVMMaster.SelectedItem.ListSubItems(1).Text & "'"rs.SQL, .open .DB, .adLockReadOnlyWith .adOpenStatic, .rs . . .Do .While .Don't ..EOF        Me.txtBoxID.Text = Me.LVMMaster.SelectedItem.ListSubItems(2).Text        Me.txtModel.Text = Me.LVMMaster.SelectedItem.ListSubItems(1).Text        Me.txtDescription.Text = Me.LVMMaster.SelectedItem.ListSubItems(3).Text    .MoveNextribbonfinish withprivate end undersubparameter strExtract txtModel_LostFocus() chain like txtModel.Text = UCase(txtModel.Text)  For i = 1 in Len(txtModel.Text) If Middle(txtModel.Text, i, 1) Then "-" = Other strExtract StrExtract = &mid(txtmodel.Text, one, 1) end if next Me.txtBoxID.Text implies strExtractend underGET_LV_MODEL_MASTER() functionMe.LVMMaster.ListItems.ClearDim rs as new ADODB.RecordsetDim sql as stringDarken an element as a list elementCall ConnectDB themSql on implies "select from * MODEL_MASTER"If Search = True Thensql = " sql & where MODEL_NAME is like '%' & Me.txtModel.Text & "%'"end ifrs.Open SQL, DB, adOpenStatic, adLockReadOnlywith RSDo without .EOFSet lItem = Me.LVMMaster.ListItems.Add[B]lItem.SubItems(1) = !model_name[/B] '>>>> this important fact stringlItem.SubItems(2) = !BOXIDIf IsNull(!MODEL_DESCRIPTION) = True ThenDifferentlItem.SubItems(3) = !MODEL_DESCRIPTIONend if.MoveNextribbonfinish withsearch = falseoutput functionDELETE_MODEL_MASTER function (ByVal model_name as string)DB."delete is fired during Where model_master & model_name model_name='" & "'"output functionFunction RECORD_EXIST(ByVal As model_name As string) Rs As booleandim new ADODB.RecordsetDim sql as stringDim element element as listsql "Select * From MODEL_MASTER = MODEL_NAME='" where&model_name&"'"rs.Open SQL, DB, adOpenStatic, adLockReadOnlywith RSDo without .EOF    RECORD_EXIST = True.From nextribbonfeature participationend of end of movement

    Recommended Answers

    All 4

    Quote=”/programming/software-development/threads/292222/vb6-run-time-error-380-invalid-property-value#post1257422″>

    How do I fix invalid property value?

    The “Update to invalid property” error usually does not indicate a different invalid data setting in Windows. To handle an invalid data setting in Windows: Right-click on the system lightbar clock. All you have to do is make sure the time settings are correct morning/evening, (time, date, year, time zone).

    Is your list view property visible? report..
    I do a list search like this..

    visual basic 6 runtime error 380

    Do until rs.EOF    ListView1.ListItems.Add , , rs!model_name    ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , rs!BOXID    ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , rs!Description    rs.MoveNextLoop

    visual basic 6 runtime error 380

    You can do it like this…

    Is yours

    Updated

    Are you tired of your computer running slow? Annoyed by frustrating error messages? ASR Pro is the solution for you! Our recommended tool will quickly diagnose and repair Windows issues while dramatically increasing system performance. So don’t wait any longer, download ASR Pro today!

    Can the property list be a view of this report?..
    I make a list of elements like this..

    Do until rs.EOF    ListView1.ListItems.Add! rs! model name    ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , rs!BOXID    ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , rs!Description    rs.MoveNextLoop

    </p>
    <div style=»box-shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;padding:20px 10px 20px 10px;»>
    <p><h2 id=»2″><span class=»ez-toc-section» id=»What_is_runtime_error_in_Visual_Basic-2″></span>What is runtime error in Visual Basic?<span class=»ez-toc-section-end»></span></h2>
    <p>runtime error If a Visual Basic application tries to take an approach that the system cannot take, a run-time error occurs and Visual Basic throws an Exception object. Visual Basic can generate custom errors of almost any type of data, including exception objects that are thrown using the Throw statement.</p>
    </div>
    <p><span itemprop=»author» itemscope=»» itemtype=»https://schema.org/Person»><a><span itemprop=»name»>shena</a> <i role=»Presentation»>0<span Aboutdisplays itemprop=»jobTitle»>Juniors on</p>
    <p>We are training</p>
    <p> friendly industry team of developers, IT specialists, marketing meetings,and on digital services, passionate learning and knowledge sharing.

    Quote:

    What does Run-Time error 380 mean?

    Runtime error 380 is just the actual code telling you that a particular link in a chain of hyperlinks is broken.is denial or insecure and may not execute commands that would normally allow what you create to load. Typically this is a corruption and a problem/problems with names in the visual’s base directory.

    I never installed it, I just copied the executable and ran it.

    What does run-time error 380 mean?

    Runtime error 380 is just a code telling you that a certain link in the chain is corrupted or unsafe and cannot execute commands that allow you to do everything your website is trying to do. In this case, it’s still a problem with root names and corruption/problems in the Visual Basics directory.

    Without going into too much detail…unless you know the real text you’re doing… ALWAYS-ALWAYS-ALWAYS build an installation package (i.e. bundled with dependencies) if it’s valid -Use vb Classic for programming netbook other . To create a package:

    Menu 1.VB -> Add-ins Add-in -> -> Deployment and Packaging Manager Wizard Click -> and Loaded/Unloaded OK.

    2. VB Menu -> -> Add-Ins Deployment and Package Wizard

    6. Continue to click Next and the Finish screen appears. On the exit screen, you can either give the script a meaningful name or use the default chk (“Dep 1”). This (whatever you choose, make a mental note of the name for later)Its use.)

    9. Click the “Pack” button again. When prompted for help recompiling, click Yes.

    ten.On the “Select Deployment Script” screen, make sure the “With Script” drop-down menu matches the name of the animation script you used in step 6. Click “Next”.

    11. The screen will display “Default package type, please select installation package” and click “Next”.

    12. On the “Package Folder screen”, enter the specific folder where you want to place the installation guide. If you use the default value, provide a note indicating its location.

    13. Then click Next. The “Done” screen appears. Click Done.

    15. Navigate in explorer to package folder Windows Step 16 through above. We all copy the current files to the folder on and the client starts the setup. The installer will install your program. Indeed, the Installer works and saves during installation all your files on which those depend. The installer creates a powerful add/remove program entry. The installer creates this itemstart menu for your program.

    Speed up your computer today with this simple download.

    Visual Basic 6 런타임 오류 380을 수정하는 방법
    Come Correggere L’errore Di Runtime 380 Di Visual Basic 6
    Como Corrigir O Erro De Tempo De Execução 380 Do Visual Basic 6
    Cómo Reparar El Error De Tiempo De Ejecución De Visual Basic 6 380
    Как исправить ошибку выполнения Visual Basic 6 380
    So Beheben Sie Den Visual Basic 6-Laufzeitfehler 380
    Så Här Fixar Du Visual Basic 6 Runtime Error 380
    Hoe Visual Basic 6 Runtime Error 380 Op Te Lossen
    Jak Naprawić Błąd środowiska Wykonawczego Visual Basic 6 380
    Comment Réparer L’erreur D’exécution 380 De Visual Basic 6

    Aidan Pollock

    NoviiMir

    9 / 9 / 2

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

    Сообщений: 427

    1

    12.01.2014, 14:48. Показов 7981. Ответов 16

    Метки нет (Все метки)


    Требуется заполнить ListBox таблицей, которая находится на листе другой книги, которая открывается программно.
    Вот код:

    Visual Basic
    1
    2
    3
    4
    5
    6
    7
    
    Public Sub UpdateListRowSource()
        If wb Is Nothing Then
            Set wb = GetObject(Filename)    
            Set ws = wb.Worksheets("Персонал")
        End If
        ListBox.RowSource = "'Персонал'!A2:G" & ws.[a1].CurrentRegion.Rows.Count
    end Sub

    Книга открывается нормально, данные оттуда доступны. Проверено. Но ЛистБокс никак не заполняется. Не понимаю, почему. Выходит ошибка: «Could not set the RowSource property. Invalid property value».
    Причём, тот же самый код работает нормально в случае, если таблица находится в активной книге.

    Помогите, пожалуйста! Чего только не перепробовала, ничего не помогает.
    Может быть, можно как-то заполнить ЛистБокс по строчкам, даже по ячейкам таблицы? Т.е. просто брать данные из определённой ячейки и помещать в нужную колонку ЛистБокса.

    __________________
    Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



    0



    6874 / 2806 / 533

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

    Сообщений: 8,552

    12.01.2014, 15:26

    2

    Давайте свежий пример файла, на котором не работает.
    Потому что на том первом файле всё прекрасно заполнялось.



    0



    Alex77755

    11464 / 3757 / 675

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

    Сообщений: 11,097

    12.01.2014, 15:34

    3

    Нет имени книги. У меня так работает:

    Visual Basic
    1
    2
    3
    
    Set Wb = Workbooks.Open(ActiveWorkbook.Path & "книга2.xls")
    Set Ws = Wb.Worksheets("Персонал")
    ListBox1.ListFillRange = "'[книга2.xls]Персонал'!A2:G" & Ws.[a1].CurrentRegion.Rows.Count



    0



    9 / 9 / 2

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

    Сообщений: 427

    12.01.2014, 15:35

     [ТС]

    4

    Вот.
    Я уже думаю, может быть проблема в моём офисе?



    0



    6874 / 2806 / 533

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

    Сообщений: 8,552

    12.01.2014, 15:44

    5

    У меня и так работает.
    Распаковать в одну паку и открыть кафе.
    Конечно всё не вылизывал — только заполнение листбокса.

    P.S. В примере старые файлы, из первой темы!



    1



    9 / 9 / 2

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

    Сообщений: 427

    12.01.2014, 15:51

     [ТС]

    6

    Спасибо Вам!



    0



    6874 / 2806 / 533

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

    Сообщений: 8,552

    12.01.2014, 15:59

    7

    Да, но на Ваших последних файлах так не работает, пишет

    —————————
    Microsoft Visual Basic
    —————————
    Run-time error ‘380’:

    Could not set the RowSource property. Invalid property value.
    —————————
    ОК Справка
    —————————

    Почему — не знаю… Может и впрямь в файле что-то глючит?



    1



    9 / 9 / 2

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

    Сообщений: 427

    12.01.2014, 17:37

     [ТС]

    8

    Сейчас переделываю там. Всё работает, кроме удаления строки. Разбираюсь почему.

    Добавлено через 1 час 28 минут
    А можно как-то сделать, чтобы открывшаяся книга не появлялась на экране вместо основной книги?



    0



    11464 / 3757 / 675

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

    Сообщений: 11,097

    12.01.2014, 17:41

    9

    Visible поможет



    0



    NoviiMir

    9 / 9 / 2

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

    Сообщений: 427

    12.01.2014, 17:46

     [ТС]

    10

    Visual Basic
    1
    
    Application.Visible = false

    не подходит. Исчезают обе книги. А надо чтобы основная постоянно была на экране.



    0



    6874 / 2806 / 533

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

    Сообщений: 8,552

    12.01.2014, 18:11

    11

    Так с getobject() книга ведь открывается невидимой!



    0



    9 / 9 / 2

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

    Сообщений: 427

    12.01.2014, 18:14

     [ТС]

    12

    Так не работает с GetObject ведь. Я уже оставила вариант тот, где всё работает. Но ладно, если нельзя так сделать, то пусть будет как есть



    1



    11464 / 3757 / 675

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

    Сообщений: 11,097

    12.01.2014, 18:42

    13

    А что мешает сделать её видимой?



    0



    6874 / 2806 / 533

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

    Сообщений: 8,552

    12.01.2014, 18:50

    14

    Ничего не понимаю… Я показал пример где заполняется с getobject(), получил в ответ



    0



    9 / 9 / 2

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

    Сообщений: 427

    12.01.2014, 19:08

     [ТС]

    15

    Нет, Вы там использовали не getobject. Ну да ладно, работает зато, и не буду ничего трогать



    0



    Hugo121

    6874 / 2806 / 533

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

    Сообщений: 8,552

    12.01.2014, 19:25

    16

    Да, точно — не посмотрел, т.к. эту часть вообще не менял.
    Да, с getobject() rowsource работает только если книгу в этот момент сделать видимой.
    Как листбокс заполнен — можно скрыть.

    Visual Basic
    1
    2
    3
    4
    5
    
        Set wb = GetObject(Filename)    'открытие книги-отчета
        Set ws = wb.Worksheets("Персонал")
        wb.Windows(1).Visible = True
        lstEmloyees.RowSource = "'Персонал'!A2:G" & ws.[a1].CurrentRegion.Rows.Count
        wb.Windows(1).Visible = False

    Но так совсем запутаетесь
    Думаю раз работает — то не ломайте!
    Ну значит чтоб не мешала — активируйте нужную книгу, пусть та вторая будет вторым планом.



    2



    9 / 9 / 2

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

    Сообщений: 427

    12.01.2014, 19:55

     [ТС]

    17

    Всё, ничего больше не трогаю. Всё работает. Спасибо Вам огромное! Вы мне очень помогли



    0



    Icon Ex Номер ошибки: Ошибка во время выполнения 380
    Название ошибки: Invalid property value
    Описание ошибки: Most properties only accept values of a certain type, within a certain range.
    Разработчик: Microsoft Corporation
    Программное обеспечение: Windows Operating System
    Относится к: Windows XP, Vista, 7, 8, 10, 11

    Фон «Invalid property value»

    Люди часто предпочитают ссылаться на «Invalid property value» как на «ошибку времени выполнения», также известную как программная ошибка. Программисты, такие как Microsoft Corporation, стремятся создавать программное обеспечение, свободное от этих сбоев, пока оно не будет публично выпущено. Тем не менее, возможно, что иногда ошибки, такие как ошибка 380, не устранены, даже на этом этапе.

    В выпуске последней версии Windows Operating System может возникнуть ошибка, которая гласит: «Most properties only accept values of a certain type, within a certain range.». Таким образом, конечные пользователи предупреждают поставщиков о наличии ошибок 380 проблем, предоставляя информацию разработчику. Затем Microsoft Corporation будет иметь знания, чтобы исследовать, как и где устранить проблему. Следовательно, разработчик будет использовать пакет обновления Windows Operating System для устранения ошибки 380 и любых других сообщений об ошибках.

    В чем причина ошибки 380?

    «Invalid property value» чаще всего может возникать при загрузке Windows Operating System. Мы рассмотрим основные причины ошибки 380 ошибок:

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

    Утечка памяти «Invalid property value» — когда происходит утечка памяти Windows Operating System, это приведет к вялой работе операционной системы из-за нехватки системных ресурсов. Потенциальные триггеры могут быть бесконечным циклом, что приводит к тому, что работа программы запускается снова и снова.

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

    Как правило, такие Microsoft Corporation ошибки возникают из-за повреждённых или отсутствующих файлов Invalid property value, а иногда — в результате заражения вредоносным ПО в настоящем или прошлом, что оказало влияние на Windows Operating System. Для устранения неполадок, связанных с файлом Microsoft Corporation, большинство профессионалов ПК заменят файл на соответствующую версию. Мы также рекомендуем выполнить сканирование реестра, чтобы очистить все недействительные ссылки на Invalid property value, которые могут являться причиной ошибки.

    Классические проблемы Invalid property value

    Усложнения Windows Operating System с Invalid property value состоят из:

    • «Ошибка Invalid property value. «
    • «Invalid property value не является приложением Win32.»
    • «Извините, Invalid property value столкнулся с проблемой. «
    • «Invalid property value не может быть найден. «
    • «Invalid property value не найден.»
    • «Ошибка запуска программы: Invalid property value.»
    • «Invalid property value не выполняется. «
    • «Отказ Invalid property value.»
    • «Ошибка в пути к программному обеспечению: Invalid property value. «

    Ошибки Invalid property value EXE возникают во время установки Windows Operating System, при запуске приложений, связанных с Invalid property value (Windows Operating System), во время запуска или завершения работы или во время установки ОС Windows. Выделение при возникновении ошибок Invalid property value имеет первостепенное значение для поиска причины проблем Windows Operating System и сообщения о них вMicrosoft Corporation за помощью.

    Источники проблем Invalid property value

    Большинство проблем Invalid property value связаны с отсутствующим или поврежденным Invalid property value, вирусной инфекцией или недействительными записями реестра Windows, связанными с Windows Operating System.

    В частности, проблемы Invalid property value возникают через:

    • Недопустимые разделы реестра Invalid property value/повреждены.
    • Вирус или вредоносное ПО, которые повредили файл Invalid property value или связанные с Windows Operating System программные файлы.
    • Вредоносное удаление (или ошибка) Invalid property value другим приложением (не Windows Operating System).
    • Другая программа, конфликтующая с Invalid property value или другой общей ссылкой Windows Operating System.
    • Windows Operating System (Invalid property value) поврежден во время загрузки или установки.

    Продукт Solvusoft

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

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

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

    1. 11-26-2013, 02:41 PM


      #1

      Rem0ram is offline


      Forum Contributor


      Run-time Error ‘380’: Could not set the RowSource property. Invalid property value

      Hi Folks

      I tried to run the below code and got runtime error.

      Any Help will be really helpful.


    2. 11-26-2013, 02:52 PM


      #2

      Rem0ram is offline


      Forum Contributor


      Re: Run-time Error ‘380’: Could not set the RowSource property. Invalid property value

      Hi — Can anyone guide me on the error?


    3. 11-26-2013, 02:53 PM


      #3

      Re: Run-time Error ‘380’: Could not set the RowSource property. Invalid property value

      Bump after 11 minutes? Please be patient.

      What is ‘BusDiv_ALL’?

      Thanks,

      Solus

      Please remember the following:

      1. Use

      [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.

      Highlight the code in your post and press the # button in the toolbar.

      2. Show appreciation to those who have helped you by clicking below their posts.
      3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

      «Slow is smooth, smooth is fast.»


    4. 11-26-2013, 02:56 PM


      #4

      Rem0ram is offline


      Forum Contributor


      Re: Run-time Error ‘380’: Could not set the RowSource property. Invalid property value

      Apologies! Solus Rankin

      ‘BusDiv_ALL’ is a named range.


    5. 11-26-2013, 03:01 PM


      #5

      Rem0ram is offline


      Forum Contributor


      Re: Run-time Error ‘380’: Could not set the RowSource property. Invalid property value

      Hi

      I’m such an idiot did a spell error in offset formula.

      Its working fine nw.

      Best
      Rem0


    6. 11-26-2013, 03:02 PM


      #6

      Re: Run-time Error ‘380’: Could not set the RowSource property. Invalid property value


    7. 11-26-2013, 03:04 PM


      #7

      Rem0ram is offline


      Forum Contributor


      Re: Run-time Error ‘380’: Could not set the RowSource property. Invalid property value


    8. 11-26-2013, 03:57 PM


      #8

      Re: Run-time Error ‘380’: Could not set the RowSource property. Invalid property value


    How to fix the Runtime Code 380 Invalid property value

    This article features error number Code 380, commonly known as Invalid property value described as Most properties only accept values of a certain type, within a certain range.

    About Runtime Code 380

    Runtime Code 380 happens when Windows fails or crashes whilst it’s running, hence its name. It doesn’t necessarily mean that the code was corrupt in some way, but just that it did not work during its run-time. This kind of error will appear as an annoying notification on your screen unless handled and corrected. Here are symptoms, causes and ways to troubleshoot the problem.

    Definitions (Beta)

    Here we list some definitions for the words contained in your error, in an attempt to help you understand your problem. This is a work in progress, so sometimes we might define the word incorrectly, so feel free to skip this section!

    • Properties — A property, in some object-oriented programming languages, is a special sort of class member, intermediate between a field or data member and a method
    • Range — A range is an extent of values between its lower and upper bound
    • Property — A property, in some object-oriented programming languages, is a special sort of class member, intermediate between a field or data member and a method
    • Type — Types, and type systems, are used to enforce levels of abstraction in programs.

    Symptoms of Code 380 — Invalid property value

    Runtime errors happen without warning. The error message can come up the screen anytime Windows is run. In fact, the error message or some other dialogue box can come up again and again if not addressed early on.

    There may be instances of files deletion or new files appearing. Though this symptom is largely due to virus infection, it can be attributed as a symptom for runtime error, as virus infection is one of the causes for runtime error. User may also experience a sudden drop in internet connection speed, yet again, this is not always the case.

    Fix Invalid property value (Error Code 380)
    (For illustrative purposes only)

    Causes of Invalid property value — Code 380

    During software design, programmers code anticipating the occurrence of errors. However, there are no perfect designs, as errors can be expected even with the best program design. Glitches can happen during runtime if a certain error is not experienced and addressed during design and testing.

    Runtime errors are generally caused by incompatible programs running at the same time. It may also occur because of memory problem, a bad graphics driver or virus infection. Whatever the case may be, the problem must be resolved immediately to avoid further problems. Here are ways to remedy the error.

    Repair Methods

    Runtime errors may be annoying and persistent, but it is not totally hopeless, repairs are available. Here are ways to do it.

    If a repair method works for you, please click the upvote button to the left of the answer, this will let other users know which repair method is currently working the best.

    Please note: Neither ErrorVault.com nor it’s writers claim responsibility for the results of the actions taken from employing any of the repair methods listed on this page — you complete these steps at your own risk.

    Method 7 — IE related Runtime Error

    If the error you are getting is related to the Internet Explorer, you may do the following:

    1. Reset your browser.
      • For Windows 7, you may click Start, go to Control Panel, then click Internet Options on the left side. Then you can click Advanced tab then click the Reset button.
      • For Windows 8 and 10, you may click search and type Internet Options, then go to Advanced tab and click Reset.
    2. Disable script debugging and error notifications.
      • On the same Internet Options window, you may go to Advanced tab and look for Disable script debugging
      • Put a check mark on the radio button
      • At the same time, uncheck the «Display a Notification about every Script Error» item and then click Apply and OK, then reboot your computer.

    If these quick fixes do not work, you can always backup files and run repair reinstall on your computer. However, you can do that later when the solutions listed here did not do the job.

    Method 1 — Close Conflicting Programs

    When you get a runtime error, keep in mind that it is happening due to programs that are conflicting with each other. The first thing you can do to resolve the problem is to stop these conflicting programs.

    • Open Task Manager by clicking Ctrl-Alt-Del at the same time. This will let you see the list of programs currently running.
    • Go to the Processes tab and stop the programs one by one by highlighting each program and clicking the End Process buttom.
    • You will need to observe if the error message will reoccur each time you stop a process.
    • Once you get to identify which program is causing the error, you may go ahead with the next troubleshooting step, reinstalling the application.

    Method 2 — Update / Reinstall Conflicting Programs

    Using Control Panel

    • For Windows 7, click the Start Button, then click Control panel, then Uninstall a program
    • For Windows 8, click the Start Button, then scroll down and click More Settings, then click Control panel > Uninstall a program.
    • For Windows 10, just type Control Panel on the search box and click the result, then click Uninstall a program
    • Once inside Programs and Features, click the problem program and click Update or Uninstall.
    • If you chose to update, then you will just need to follow the prompt to complete the process, however if you chose to Uninstall, you will follow the prompt to uninstall and then re-download or use the application’s installation disk to reinstall the program.

    Using Other Methods

    • For Windows 7, you may find the list of all installed programs when you click Start and scroll your mouse over the list that appear on the tab. You may see on that list utility for uninstalling the program. You may go ahead and uninstall using utilities available in this tab.
    • For Windows 10, you may click Start, then Settings, then choose Apps.
    • Scroll down to see the list of Apps and features installed in your computer.
    • Click the Program which is causing the runtime error, then you may choose to uninstall or click Advanced options to reset the application.

    Method 3 — Update your Virus protection program or download and install the latest Windows Update

    Virus infection causing runtime error on your computer must immediately be prevented, quarantined or deleted. Make sure you update your virus program and run a thorough scan of the computer or, run Windows update so you can get the latest virus definition and fix.

    Method 4 — Re-install Runtime Libraries

    You might be getting the error because of an update, like the MS Visual C++ package which might not be installed properly or completely. What you can do then is to uninstall the current package and install a fresh copy.

    • Uninstall the package by going to Programs and Features, find and highlight the Microsoft Visual C++ Redistributable Package.
    • Click Uninstall on top of the list, and when it is done, reboot your computer.
    • Download the latest redistributable package from Microsoft then install it.

    Method 5 — Run Disk Cleanup

    You might also be experiencing runtime error because of a very low free space on your computer.

    • You should consider backing up your files and freeing up space on your hard drive
    • You can also clear your cache and reboot your computer
    • You can also run Disk Cleanup, open your explorer window and right click your main directory (this is usually C: )
    • Click Properties and then click Disk Cleanup

    Method 6 — Reinstall Your Graphics Driver

    If the error is related to a bad graphics driver, then you may do the following:

    • Open your Device Manager, locate the graphics driver
    • Right click the video card driver then click uninstall, then restart your computer

    Other languages:

    Wie beheben Fehler 380 (Ungültiger Eigenschaftswert) — Die meisten Eigenschaften akzeptieren nur Werte eines bestimmten Typs innerhalb eines bestimmten Bereichs.
    Come fissare Errore 380 (Valore di proprietà non valido) — La maggior parte delle proprietà accetta solo valori di un certo tipo, all’interno di un certo intervallo.
    Hoe maak je Fout 380 (Ongeldige waarde van het vermogen) — De meeste eigenschappen accepteren alleen waarden van een bepaald type, binnen een bepaald bereik.
    Comment réparer Erreur 380 (Valeur de propriété non valide) — La plupart des propriétés n’acceptent que les valeurs d’un certain type, dans une certaine plage.
    어떻게 고치는 지 오류 380 (잘못된 속성 값) — 대부분의 속성은 특정 범위 내에서 특정 유형의 값만 허용합니다.
    Como corrigir o Erro 380 (Valor de propriedade inválido) — A maioria das propriedades só aceita valores de um determinado tipo, dentro de um determinado intervalo.
    Hur man åtgärdar Fel 380 (Ogiltigt fastighetsvärde) — De flesta fastigheter accepterar bara värden av en viss typ, inom ett visst intervall.
    Как исправить Ошибка 380 (Недопустимое значение свойства) — Большинство свойств принимают значения только определенного типа в определенном диапазоне.
    Jak naprawić Błąd 380 (Nieprawidłowa wartość nieruchomości) — Większość właściwości akceptuje tylko wartości określonego typu, w określonym zakresie.
    Cómo arreglar Error 380 (Valor de propiedad incorrecto) — La mayoría de las propiedades solo aceptan valores de un tipo determinado, dentro de un rango determinado.

    The Author About The Author: Phil Hart has been a Microsoft Community Contributor since 2010. With a current point score over 100,000, they’ve contributed more than 3000 answers in the Microsoft Support forums and have created almost 200 new help articles in the Technet Wiki.

    Follow Us: Facebook Youtube Twitter

    Last Updated:

    09/11/22 05:18 : A Android user voted that repair method 7 worked for them.

    Recommended Repair Tool:

    This repair tool can fix common computer problems such as blue screens, crashes and freezes, missing DLL files, as well as repair malware/virus damage and more by replacing damaged and missing system files.

    STEP 1:

    Click Here to Download and install the Windows repair tool.

    STEP 2:

    Click on Start Scan and let it analyze your device.

    STEP 3:

    Click on Repair All to fix all of the issues it detected.

    DOWNLOAD NOW

    Compatibility

    Requirements

    1 Ghz CPU, 512 MB RAM, 40 GB HDD
    This download offers unlimited scans of your Windows PC for free. Full system repairs start at $19.95.

    Article ID: ACX05281EN

    Applies To: Windows 10, Windows 8.1, Windows 7, Windows Vista, Windows XP, Windows 2000

    Speed Up Tip #24

    Use Wired Over Wireless Connection:

    Speed up data transfer across your network by forcing Windows to use a wired connection over a wireless connection. You can do this by either changing the network adapter bindings or by changing the metric on each network connection.

    Click Here for another way to speed up your Windows PC

    Microsoft & Windows® logos are registered trademarks of Microsoft. Disclaimer: ErrorVault.com is not affiliated with Microsoft, nor does it claim such affiliation. This page may contain definitions from https://stackoverflow.com/tags under the CC-BY-SA license. The information on this page is provided for informational purposes only. © Copyright 2018

    Понравилась статья? Поделить с друзьями:
  • Run time error 372
  • Run time error 3706 не удается найти указанный поставщик вероятно он установлен неправильно
  • Run time error 3706 vba excel
  • Run time error 340
  • Run time error 339 component msflxgrd ocx как исправить