I'm trying to get data from a TXT file into a calc sheet using a macro. When I used LoadComponentFromURL, it opens in writer (though other files open fine this way) and using a Link to External Data source doesn't work at all (can't even be done manually using the dialogs).
Can someone please tell me some way to force the file to open in calc? Or any other workaround to have a macro put that data into an open spreadsheet?
Code: Select all
oSheet.link(sURL, "Sheet1", "scalc: Text - txt - csv (OpenOffice.org Calc)", "32/MRG,34,0,1", "NORMAL")
Code: Select all
aArgs(0).Name = "FilterName"
aArgs(0).Value = "Repeating space delimeted" ' "scalc: Text - txt - csv (OpenOffice.org Calc)"
aArgs(1).Name = "FilterFlags"
aArgs(1).Value = "32/MRG,34,0,1" '32/MRG for repeating spaces, 34 for "
aArgs(3).Name = "ReadOnly"
aArgs(3).Value = True
OpenLST = oFrame.LoadComponentFromUrl(sURL, "_blank", 2, aArgs())