[Solved] Inserting Data from Web Into a Specific Cell
Posted: Sun Jun 12, 2016 11:50 pm
Hello there,
I have found the code bellow on this forum. I have been trying to get the link downloaded into a specific cell... without any success. Is there anyway I can get the link downloaded into a specific cell?
Code adapted, but not working:
Thanks all for any help,
M
I have found the code bellow on this forum. I have been trying to get the link downloaded into a specific cell... without any success. Is there anyway I can get the link downloaded into a specific cell?
Code: Select all
Sub InsertWebLinkAtSelection(url As String)
Dim oDoc As Object
Dim oSelection
Dim oAddress As new com.sun.star.table.CellAddress
oDoc = ThisComponent
oSelection = oDoc.getCurrentController().getSelection()
if oSelection.supportsService("com.sun.star.sheet.SheetCell") then
oAddress = oSelection.getCellAddress()
oDoc.AreaLinks.insertAtPosition(oAddress,url,"HTML_all","calc_HTML_WebQuery","0 0")
endif
End Sub
Code: Select all
Sub InsertWebLinkAtSelection(url As String)
Dim oDoc As Object
Dim oSelection
Dim oAddress As new com.sun.star.table.CellAddress
oDoc = ThisComponent
oSelection = oDoc.Sheets.getByName("tmp")
if oSelection.supportsService("com.sun.star.sheet.SheetCell") then
oAddress = oSelection.getCellRangeByName("A9")
oDoc.AreaLinks.insertAtPosition(oAddress,url,"HTML_all","calc_HTML_WebQuery","0 0")
endif
End Sub
M