Export to Excel: programmatically create new Excel sheet - excel

I need to export some data to Excel, and I'm building the document 'manually': strings with \t for new cell and \r\n for new line.
My question is how to insert in similar way new sheet in same document?

You export a CSV file, not an Excel file. MS Excel just opens CSV file and integrate file data in a sheet. You cannot have more than one sheet.
For exporting real Excel files you will an Excel library that can be integrated with your programming language.

Related

How to save an Excel sheet and Word document into single pdf with VBA

I know how to export an Excel sheet to pdf with VBA, and I have seen how to export a Word document to pdf with VBA. However, I can't figure out how to export both together to a single pdf. Is there a way to do this using VBA? Thank you!
You need to combine both documents into a single one to get the job done. In VBA you can use the Copy and Paste methods available in both applications to create a single document and then use the Document.ExportAsFixedFormat2 method which saves a document in PDF or XPS format.

Create PDF bookmarks Within Excel Workbook

I'm attempting to build a monthly process that converts an excel file to a PDF with bookmarks for each respective sheet. I'm not seeing a method to successfully create PDF bookmarks from within the Excel workbook. Can this be accomplished without third-party software?
What I've tried:
Using Header 1 for a cell as well as an entire row.
Putting Excel Book Mark within the file using a hyperlink reference.
Adding named range.
OneDrive flow Convert File
Adding a Header.
Reviewed some VBA Ref libraries hoping to find an object.bookmark type approach.
Unfortunately, all attempts have resulted in a PDF file with no bookmarks.
Is there a method to create PDF Bookmarks from Excel? Possibly a VBA ref library that I am unaware of or some front-end trick? Unfortunately, I'm stuck working only with Microsoft tools. Adobe's Excel Add-On does exactly what I'm trying to achieve.

How do you make a workbook or worksheet read only using SpreadsheetML / Excel 2003 XML?

I am using SpreadsheetML to generate an Excel spreadsheet with multiple worksheets.
I would like to make the document read only when opened with Excel. How can I do this?
(I appreciate that a user could open the XML file as text and do what they want with it so this is read-only in the loosest sense.)
Thanks
Spreadsheet ML references:
https://en.wikipedia.org/wiki/Microsoft_Office_XML_formats#Excel_XML_Spreadsheet_example
http://m8y.org/Microsoft_Office_2003_XML_Reference_Schemas/Help/html/spreadsheetml_HV01151864.htm
https://en.wikipedia.org/wiki/SpreadsheetML

Create a ListBox in Excel using Perl

I have a excel spreadsheet that I've created with Perl (Excel::Writer::XLSX) and I'm needing to add a ListBox, but I'm not sure how to do that.
The module does provide a framwork to use vba
from the doc
"An example of adding macros to an Excel::Writer::XLSX file using a VBA project file extracted from an existing Excel xlsm file.
The extract_vba utility supplied with Excel::Writer::XLSX can be used to extract the vbaProject.bin file."
An embedded macro is connected to a form button on the worksheet.
Take a look at marco

Copy data from Excel to Word

I have a .csv file which I can export and from which I need to copy data into word.
I know how to get the relevant data from Excel and format my .csv file with VBA, however I don't know how to get my data from that Excel file to Word.
Basically this is how a line of my formatted .csv file looks (I Got rid of all the info I don't need).
For clarification: 1st long nr. is personnel 2nd one is token.
And I need to fill that info into the following table in word (Not everything gets filled in).
And one extra thing, depending on the extention of the email address #mc or #lmc, I need a different file opened (Different languages). How would I best do that?
Possible algorithm:
In your Excel document, develop a VBA macro that
Copy data/elements from Excel document
Open your word document
Paste excel data to word document (to the places you want)
Save word document
Close word document
Here is some code for inspiration of how to do that.

Resources