954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Rnu-Time Error: 380 - Invalid property value

Good morning everybody:
I am attempting to populate a listview control on Form Load()
and I get a Run-Time Error: 380 - Invalid property value. Below is the line to generates the error:

lvw.ListItems(lvw.ListItems.Count).SubItems(1) = OutlookAddressEntry.Address


Below is alos my entire FormLoad module:

Private Sub Form_Load()
Set OutlookApp = New Outlook.Application
Set OutlookMailItem = OutlookApp.CreateItem(olMailItem)
Set OutlookNameSpace = OutlookApp.GetNamespace("MAPI")

lvw.ListItems.Clear

For Each OutlookAddressList In OutlookNameSpace.AddressLists
    For Each OutlookAddressEntry In OutlookAddressList.AddressEntries
        lvw.ListItems.Add , , OutlookAddressEntry.Name
        lvw.ListItems(lvw.ListItems.Count).SubItems(1) = OutlookAddressEntry.Address
        lvw.ListItems(lvw.ListItems.Count).SubItems(2) = OutlookAddressEntry.ID
        lvw.ListItems(lvw.ListItems.Count).Tag = OutlookAddressEntry.ID
    Next
Next
End Sub


Any help will b greatly appreciated
Thanks,
tgifgemini.

tgifgemini
Junior Poster
113 posts since Jul 2007
Reputation Points: 22
Solved Threads: 0
 

try
.count -1
when there are 3 entries ,count would be 3, but the last index is 2 since it starts at 0

plusplus
Posting Whiz in Training
207 posts since Jul 2007
Reputation Points: 10
Solved Threads: 16
 

I changed my codes to:

lvw.ListItems.Add , , OutlookAddressEntry.Name
        lvw.ListItems(lvw.ListItems.Count).SubItems(1) = OutlookAddressEntry.Address
        lvw.ListItems(lvw.ListItems.Count).SubItems(2) = OutlookAddressEntry.ID
        lvw.ListItems(lvw.ListItems.Count).Tag = OutlookAddressEntry.ID


But I still get compile error: 380 - Invalid property value.
sorry for the inconveniences.
tgifgemini.

tgifgemini
Junior Poster
113 posts since Jul 2007
Reputation Points: 22
Solved Threads: 0
 

Sorry my mistake. I changed my codes to:

lvw.ListItems.Add , , OutlookAddressEntry.Name
        lvw.ListItems(lvw.ListItems.Coun-1t).SubItems(1) = OutlookAddressEntry.Address
        lvw.ListItems(lvw.ListItems.Count-1).SubItems(2) = OutlookAddressEntry.ID
        lvw.ListItems(lvw.ListItems.Count-1).Tag = OutlookAddressEntry.ID


But I got the same compile error: 380-invalid property value.
tgifgmini.

tgifgemini
Junior Poster
113 posts since Jul 2007
Reputation Points: 22
Solved Threads: 0
 

Now I got the above title error on the code below:

lvw.ListItems(lvw.ListItems.Count - 1).SubItems(1) = OutlookAddressEntry.Address


Thanks
tgifgemini.

tgifgemini
Junior Poster
113 posts since Jul 2007
Reputation Points: 22
Solved Threads: 0
 

I finally found a solution for switching from active form to another form and back again. Here it is:

In the code for form1
Form_Unload(-1)
set form1=Nothing
Load (form2)
form2.visible=True

In the code for form2
Form_Unload(-1)
set form2=Nothing
Load (form1)
form1.visible=True

The switching is quite smooth and the memory is cleared for the unloaded form.

Good Luck,
Suresh

sureshd2010
Newbie Poster
2 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Try starting at Subitems(0) on your listview

missjace
Newbie Poster
2 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

hi, i am developing a personal firewall application with Visual Basic 6.0. Basically all the coding been done. and yet i had this run time error 380 and line of code which occur error highlighted with bright yellow color attached as below:

Item.Text = mdlFile.GetFileDescription(Connection(i).Filename)

can anyone please help me with this? helps is kindly appreciated.

p/s: the personal firewall system i proposed for my diploma final year project. hope the system can run well thanks.

cschrishoo
Newbie Poster
1 post since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You