I would like to know if a macro exists so that Calc it inserts the content of an archive of simple .txt text in a specific cell.
I would like that it made this when opening automatically the spread sheet.
Thanks.
Yes, there is. And guess where you can find it: It's all in your head already.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
... inserts the content of an archive of simple .txt text in a specific cell.
You are so unspecific that you want us to read your mind. Do you really want to read a whole text file with line-breaks and everything into a single spreadsheet cell? Never seen such a thing.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Sub Main
oCell = thisComponent.Sheets.getByIndex(0).getCellByPosition(0,0)
iNumber = freefile()
open "/tmp/dummy.txt" for input as iNumber
While not eof(iNumber)
Line Input #iNumber, sLine
If sLine <>"" then
sMsg = sMsg & sLine & chr(10)
end if
wend
Close #iNumber
oCell.setString(sMsg)
End Sub
Most of it copied from the Basic help.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Put your txt file in it's own directory.
File>New>Database...
[X] Connect to existing database
Type: Text
Specify the directory of your text database.
Specify details of your text file (and other files that may be in the same directory as well)
[X] Register database (for further use in Writer or Calc)
Store the database document.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice