Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I am looking forward to add names array to listbox created.
please its urgent requirement to be fulfilled
Point to be noted: I dont have any sort of field by the name "names" in qvw
sub irf1
Dim names(100)
Set objExcel = CreateObject("Excel.Application")
'Msgbox("Hi")
Set objWorkbook = objExcel.Workbooks.Open _
("C:\Employee.xls")
msgbox("Hello")
rowcount =2
Do Until objExcel.Cells(rowcount,1).Value = ""
names(rowcount-2)=objExcel.Cells(rowcount, 1).Value
' msgbox(names(rowcount-2))
'
' msgbox(objExcel.Cells(rowcount, 1).Value)
rowcount = rowcount + 1
'
Loop
set LB = ActiveDocument.ActiveSheet.CreateListBox
set BoxProp=LB.GetProperties
BoxProp.Def.Name = "names"
LB.SetProperties BoxProp
end sub
You can't populate listbox data using a macro. Even if you could, the data would not be connected to anything so would be of limited use.
Could you describe what overall problem you are trying to solve and maybe we can suggest some alternatives?
-Rob
Hi Rob,
I am looking forward to fetch the data from excel sheet on single click on button and syn. with other existing data.
I mean if I select data say EmpID which is fetch from excel sheet via action button then it should have to have association with other existing data too.
Please find the attached files.
Hi
I am afraid that your example does not explain why you don't just load the data in the load script.
Regards
Jonathan
Hi Jonathan,
Yes I can do that,but i want the application should be user friendly to end user,So He/She can add data via action button. Can you help me out in the way I am looking forward to solve this issue.
Hi
Then create a macro sub:
Sub Reload
ActiveDocument.Reload
End Sub
And create an action button to call the macro. Or simpler still, train the users to use the reload button from the desktop client.
Bear in mind that user reloads can create all sorts of problems.
Regards
Jonathan