Hi all,
I'm doing calibrations of measurement devices. Results are saved in a spreadsheet.
Now I've the idea to embed the settings of the measurement device in this spreadsheet, as well.
This settings are a small ASCII-File.
I tried to to rename this file to .bmp and to insert it like as a picture. But this is not working.
(Rename from .ods to .zip and put the file to picture folder has not worked, too)
Does anybody knows if this is possible and how to do?
Best regards,
VBandOoffice
[Solved] Embed ASCII File in Spreadsheet
-
- Posts: 33
- Joined: Tue Jul 31, 2018 10:11 am
[Solved] Embed ASCII File in Spreadsheet
Last edited by VBandOoffice on Fri Dec 07, 2018 9:01 am, edited 1 time in total.
LibreOffice 7.5, Windows 10, VB.net 2019, C#
Re: Embed ASCII File in Spreadsheet
1. Open the ASCII file with Notepad
2. Copy all
3. Paste into Calc.
Or
1. Open the ASCII file with Notepad
2. Press Alt+PrtScr to copy Notepad window as a
3. Paste image into Calc.
4. Repeat as required.
Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
2. Copy all
3. Paste into Calc.
Or
1. Open the ASCII file with Notepad
2. Press Alt+PrtScr to copy Notepad window as a
3. Paste image into Calc.
4. Repeat as required.
Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
-
- Posts: 33
- Joined: Tue Jul 31, 2018 10:11 am
Re: Embed ASCII File in Spreadsheet
Yes, this will work. But I'm looking for a solution to embed the file - not only the ASCII text.
If I don't find the solution, I'm searching for, maybe I will use this one.
Regards,
VBandOoffice
If I don't find the solution, I'm searching for, maybe I will use this one.
Regards,
VBandOoffice
LibreOffice 7.5, Windows 10, VB.net 2019, C#
Re: Embed ASCII File in Spreadsheet
See Linking to external data and following on pages 270 - 282 of the Calc Guide.
This is Insert > Object > OLE Object > Further objects > tick Create from file > Navigate to some text.txt stored on my Desktop. I have the option to bring in the file or to link to it.
This is the macro I recorded while doing so: When running it It opens the window at Insert > Object > OLE Object ..., and I have to complete the selection.
See also 7.11. Insert An OLE Object in Pitonyak's book which is for inserting in Writer.
This is Insert > Object > OLE Object > Further objects > tick Create from file > Navigate to some text.txt stored on my Desktop. I have the option to bring in the file or to link to it.
This is the macro I recorded while doing so: When running it It opens the window at Insert > Object > OLE Object ..., and I have to complete the selection.
Code: Select all
sub zz_ole
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertObject", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertObject", "", 0, Array())
end sub
Code: Select all
7.11. Insert An OLE Object
The rumor is that with OpenOffice version 1.1, the following code will insert an OLE object
into a write document. The CLSID may be an external OLE object.
Listing 7.37: Insert an OLE object.
SName = "com.sun.star.text.TextEmbeddedObject"
obj = ThisComponent.createInstance(sName)
obj.CLSID = "47BBB4CB-CE4C-4E80-A591-42D9AE74950F"
obj.attach(ThisComponent.currentController().Selection.getByIndex(0))
If you select an embedded object in writer, you can access its API with:
oModel = ThisComponent.currentController().Selection.Model
This provides the same interface to the object as if you created the object by loading a
document with loadComponentFromURL
- Attachments
-
- test.ods
- (16.81 KiB) Downloaded 124 times
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
-
- Posts: 33
- Joined: Tue Jul 31, 2018 10:11 am
Re: Embed ASCII File in Spreadsheet
Hi John_Ha,
thank you very much - this looks pretty good to me. I will test it and post result (maybe this will take one or two days).
Best regards,
VBandOoffice
thank you very much - this looks pretty good to me. I will test it and post result (maybe this will take one or two days).
Best regards,
VBandOoffice
LibreOffice 7.5, Windows 10, VB.net 2019, C#