Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default ListView Control

Hi,
I'm having a bit of trouble getting started populating a ListView control
placed on an Excel worksheet. I'm using the Microsoft ListView Control,
Version 6.0. I have Excel 2003 SP2. I've already used the same control in a
form in VB 6 with no problem. My code for setting up multiple column
headers, enabling gridlines, and adding rows of data isn't quite taking. The
same code in VB 6 is not working in VBA and I'm just looking for a little
starter help to get me going.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default ListView Control

Seeing some code would help to help. "Not working" is meaningless -unless
someone big wants his money back..

Best wishes Harald


"RLang" wrote in message
...
Hi,
I'm having a bit of trouble getting started populating a ListView
control
placed on an Excel worksheet. I'm using the Microsoft ListView Control,
Version 6.0. I have Excel 2003 SP2. I've already used the same control
in a
form in VB 6 with no problem. My code for setting up multiple column
headers, enabling gridlines, and adding rows of data isn't quite taking.
The
same code in VB 6 is not working in VBA and I'm just looking for a little
starter help to get me going.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default ListView Control

Hi Harald, starting off simple, I'm expecting the code below to create three
columns with headers and one data line entry. This code is identical to what
I'm using in VB 6.0 to use the ListView control. The control is embedded on
the worksheet ("start") surface and is named ListView1. Right now only one
column appears with the "Rec" header title and then empty data records follow
with gridlines.

Sub CommandButton4_Click()

Dim itmX

Sheets("start").ListView1.ListItems.Clear
Sheets("Start").ListView1.ColumnHeaders.Add , , "Rec",
Sheets("Start").ListView1.Width * (3 / 5)
Sheets("Start").ListView1.ColumnHeaders.Add , , "Date/Time",
Sheets("Start").ListView1.Width * (1 / 5)
Sheets("Start").ListView1.ColumnHeaders.Add , , "Prod ID",
Sheets("Start").ListView1.Width * (1 / 5)

Set itmX = Sheets("start").ListView1.ListItems.Add()
itmX.Text = "1234"
itmX.SubItems(1) = "1/1/2008"
itmX.SubItems(2) = "890"

End Sub


"Harald Staff" wrote:

Seeing some code would help to help. "Not working" is meaningless -unless
someone big wants his money back..

Best wishes Harald


"RLang" wrote in message
...
Hi,
I'm having a bit of trouble getting started populating a ListView
control
placed on an Excel worksheet. I'm using the Microsoft ListView Control,
Version 6.0. I have Excel 2003 SP2. I've already used the same control
in a
form in VB 6 with no problem. My code for setting up multiple column
headers, enabling gridlines, and adding rows of data isn't quite taking.
The
same code in VB 6 is not working in VBA and I'm just looking for a little
starter help to get me going.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default ListView Control

Nevermind, I think I've got her working now.

"RLang" wrote:

Hi Harald, starting off simple, I'm expecting the code below to create three
columns with headers and one data line entry. This code is identical to what
I'm using in VB 6.0 to use the ListView control. The control is embedded on
the worksheet ("start") surface and is named ListView1. Right now only one
column appears with the "Rec" header title and then empty data records follow
with gridlines.

Sub CommandButton4_Click()

Dim itmX

Sheets("start").ListView1.ListItems.Clear
Sheets("Start").ListView1.ColumnHeaders.Add , , "Rec",
Sheets("Start").ListView1.Width * (3 / 5)
Sheets("Start").ListView1.ColumnHeaders.Add , , "Date/Time",
Sheets("Start").ListView1.Width * (1 / 5)
Sheets("Start").ListView1.ColumnHeaders.Add , , "Prod ID",
Sheets("Start").ListView1.Width * (1 / 5)

Set itmX = Sheets("start").ListView1.ListItems.Add()
itmX.Text = "1234"
itmX.SubItems(1) = "1/1/2008"
itmX.SubItems(2) = "890"

End Sub


"Harald Staff" wrote:

Seeing some code would help to help. "Not working" is meaningless -unless
someone big wants his money back..

Best wishes Harald


"RLang" wrote in message
...
Hi,
I'm having a bit of trouble getting started populating a ListView
control
placed on an Excel worksheet. I'm using the Microsoft ListView Control,
Version 6.0. I have Excel 2003 SP2. I've already used the same control
in a
form in VB 6 with no problem. My code for setting up multiple column
headers, enabling gridlines, and adding rows of data isn't quite taking.
The
same code in VB 6 is not working in VBA and I'm just looking for a little
starter help to get me going.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ListView control in Excel 2007 jumps! sgk Excel Programming 0 November 14th 07 07:31 PM
Why does Listview control shift to top on multi-page form? Matt[_41_] Excel Programming 1 September 1st 06 08:27 PM
Images cannot be assigned to Listview control kvenku[_15_] Excel Programming 0 June 9th 04 12:56 PM
How to add icons in the Listview control kvenku[_13_] Excel Programming 3 June 3rd 04 01:07 PM
How to use Listview control kvenku[_10_] Excel Programming 2 June 1st 04 05:45 AM


All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"