How to use Powershell to paste an excel table into powerpoint while keeping the formatting - excel

I am trying to paste several excel tables into powerpoint using Powershell:
$shape = $slide.Shapes.PasteSpecial($ppPasteJPG,$false,$null,$null,$null,$null)
It seems to work perfectly with two of the 6 excel tables I am pasting, but with the other 4 it does not. The two it works with are .xlsm, whereas the 6 are xlsx. Why is this, and how can I make it work with all of them? How can I paste the selected ranges from the xlsx files into PowerPoint such that they are formatted as they are in excel?

You can paste while keeping source formatting by using the CommandBars.ExecuteMso from either the presentation object or the application object. The command string is "PasteSourceFormatting" so after you've activated the Cell you're trying to insert the table into, run the command:
$pptApplication.CommandBars.ExecuteMso("PasteSourceFormatting");
After you've done that, use Shapes to find the newly inserted table to modify placement, size, etc.

Related

DataGrip Copy Table Values to Excel Error

I am using DataGrip 2020.1.5 and trying to Copy and Paste certain table values from my table (DB is Oracle) to an Excel file.
The portion of values I want to copy is highlighted below.
Values are pasted in a strange format on the Excel; different rows, but all on one column
Paste Format is selected as Tab-seperated (TSV) and I tried to change the settings by Paste Format > Configure CSV Formats... by changing value seperator, but it made no difference.
Column names are also pasted even if I have not ticked the First row is header.
I also tried this copying on both MS Excel 2010 and 2016 still the same output.
I checked about this on the web, also Jetbrains documentation but didn't find anything useful. Perhaps I am missing something here.
Any help would be appreciated, Thanks!
First, what you are trying to do is to copy values to the clipboard and then paste them to Excel. DataGrip has nothing to do with how Excel pastes values, but DataGrip can copy them in the needed way.
I assume you need TSV format for your data in the clipboard. So you need to copy your values in TSV. To do so, please choose the corresponding extractor in the drop-down:
The option you tick, Paste format, has nothing to do with Excel or any other third party application. It defines in what format you have values when you are pasting into the DataGrip's spreadsheet.

VBA excel macro to copy only values of a file

i am trying to create a code in VBA that takes each tab of an excel files and paste everything in another file keeping the same formatting but without formulas (only values). Is there an easy way to do this ?

Not able to convert Excel file to CSV

I have an Excel file with 2 sheets. One with my data with headers and the other is for references. It's basically a template where I am using Sheet 2 for reference values. When I save the file to CSV, it saves all garbage data which I think are due to 2 work sheets and the references between them.
Please find the attached excel sheet and let me know how I can do a proper conversion?
Notes:
I am using Office 2010 Standard
I have tried copying and pasting with "Values" option.
I have tried copying and pasting with "Merge Destination Formatting"
Nothing worked.
I was able to find the solution.
When you copy the selected range of records and paste them to New excel file, just drag the cursor some columns ahead. Remove the newly added columns (Not sure from where they come). Now do a Save As CSV. Thats it.

Copy a column of formulas to a closed workbook in Excel

I have a lot of data into Excel files.
There are about 174 files. Each is named Book2.xslx through Book174.xlsx
I have a master document where I have a column of formulas that I would like to paste (or insert) into each of these spreadsheets without having to actually open each one individually.
Does someone know any code I can use to do this?
As an example, I would say I would want to copy the range P:P - the whole of column P - and insert it or paste it into Column P in the closed workbooks.
Can this be done? If it works , and I want to insert different ranges and cells every time I wanted something different inserted or pasted? Or is there a macro for example, that I could run , that would copy what I've selected to the same place in every unopened spreadsheet named Book*.xlsx?
You cannot do this on existing files without opening them (whether in Excel, or using FSO, as the Object Model won't be available to apply to those files
having said that, it is possible to automate the modifications using VBA.
If you would post your code, we can help you improve it or resolve any issues with bugs or performance

Fonts look different when inserting Excel table in a Word document

I am trying to use a VBA macro (for Office 2003) to do the following:
In Excel, the user will select a range of cells
In Word the user will call the macro (via a button or shortcut) to insert the selected Excel range as an embedded object
The code is not the problem so far, my problems are:
Given that the user is working in a Word document, most likely will use the same fonts in Excel
When Excel range was inserted in Word and they both use the same font names and sizes, they look different inside Word ( fonts look as if they stretched a bit)
Styling Cell borders in Excel is not like styling cell borders in Word
I do appreciate any advice on this regards
When you paste as an Excel Worksheet Object, what Word is actually displaying is an image created by Excel. Notice that you can't select any text, for example. Word appears to be distorting the image ever so slightly, so that the fonts won't line up.
Edit: I can't speak for Office 2003, but Office 2007 defaults to the HTML format using PasteExcelTable. The exact macro statement is
Selection.PasteExcelTable False, False, False
This will give formatting that is compatible with Word, but unfortunately the data is not live and won't get updated as the spreadsheet is changed. If your requirements don't include live update, try this method.
Is it possible to have the macro creating a table out of the cells (as normally happens when you manually copy them), rather than inserting an Excel Object.
The best visual results results can be achieved by using Selection.CopyPicture(Appearance, Format); however, you will not be able to edit the data inside Word as you will only get a picture.

Resources