Converting an Excel file to a PDF /word file

I am currently trying to convert an excel file I scraped from the internet into a PDF/Word file. I have tried the ‘Read range’, ‘Read row’ and ‘Read cell’ activities, but all resulted in errors where e.g. the datatable could not be converted into a string to write/type into the Word document.
Is there any easier way to convert an excel to a word/pdf file?

You might look at using the built-in features of the applications. Like you can import a spreadsheet into Word for example by using click and hotkey activities or even copy/paste.

I suppose if you want to convert the datatable to a string you could write it to a CSV then use Read Text File and it will save it to a string, but the cells will be spaced by delimiters.

Also, there could be some uses of LINQ functions to set up the data the way you want, but I’m not an expert on those.

To convert Datatable to string use “Output Datatable” activtiy.

Thank you for suggestions. I have tried to use hotkey activities, and copy and paste, but I have run into problems. The software does not allow me to copy and paste the spreadsheet, it only allows me to select the entire window, which pastes to a word document as “ExcelBook1”, which is the name of the Excel document. The same problem exists with hotkeys. Do you have any suggestions as to how to overcome this problem? Thanks.

I have tried to do this, but have encountered problems. Using the “Read/select Range” activities, I get the error message that a String cannot be converter to a datatable. Using write csv, I get similar errors to do with strings and datatables. Any suggestions as to how I can rectify this?

can you try like this.

  1. open excel file
  2. send hot key F12
  3. use desktop recorder and get the file name input box element in Save as dialog box.
  4. use input activity to send file name like this filename+(k[tab])p(k[enter]) – this will let u to select pdf option in format
1 Like

I managed to get it to work by exporting the excel spreadsheet as a pdf, but the resulting pdf was not well-formatted. I’ll try this now, thank you for the suggestion.

If you have a PDF editor like CutePDF or Adobe Pro you could probably import the document.

It was also suggested that you could use Output Datatable activity. That converts the datatable to a string. However, all the spaces are replaced with commas.

If you are trying to use the copy/paste method, you just need to do a select all such as Ctrl+A, then Ctrl+C, and (maybe use the Get Clipboard to store it into a variable) then paste to copied table to Word or wherever.

Hi, I tried this approach, but this approach divide the one invoice page into tow different file, while saving in a pdf format.

In case if your Excel file comprises contacts information, then I would suggest you to use Excel to PDF Converter to convert Excel file contacts into PDF on Mac OS X. The software allows to convert unlimited Excel file contacts into PDF in a single go without any hassle. So, go for it.