excel

Copper Contributor

Dear All,

I’ve a problem with excel. Only in the last week, I realized that if I copy a table containing data (number and text) from excel and copy it as I always did in outlook, it’s copied only as text, losing the formatting as a table with data number.
If, on the other hand, I copy raw data from a computer system interfaced with a chemical laboratory instrument, it would copy and paste as a numerical series, even if the symbol of N (Newton) was present in the cell, now instead it also drags me the symbol N and recommends only the "paste as text ". What happened? Why can't I do "special paste" anymore? Why does it seem like I can't format anymore? There are also other copy paste problems but I don't know how to explain them in a few lines, so I start to understand what is wrong with the formatting.
I have Microsoft Office Professional Plus 2016.
I installed some programs and unistalled them in these last weeks.

Thank you ll

3 Replies

@PBinda 

 

Maybe I can help you with this information.

Add a table to a message

https://support.microsoft.com/en-gb/office/add-a-table-to-a-message-59766ab4-0fe5-4520-ba0b-e34f8b8c...

Paste options

https://support.microsoft.com/en-gb/office/paste-options-8ea795b0-87cd-46af-9b59-ed4d8b1669ad?ui=en-...

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

@NikolinoDE  Thank you for your help.

 

I tried to read briefly what is reported in the two links. Unfortunately it explains how to use excel and all its features, which I already know how to use, but unfortunately I have not found an answer in case of this non-dysfunction excel-outlook and excel-instrumental data recording program.

 

I can't find an answer regarding the formatting problem.

I try again...so I hope to find the answer to this problem.

Thank you for your help

P.

@PBinda 

Try this example.

The example assumes that the e-mail and workbook are already open and copies the area from B2 to C6 into the e-mail - including all formatting.

So that the declaration of the variables is possible, please add references to the Word and Excel libraries to the project (in VBA via Extras / References).

 

 

Sub PasteFormattedTable()
  Dim Doc As Word.Document
  Dim wdRn As Word.Range
  Dim Xl As Excel.Application
  Dim Ws As Excel.Worksheet
  Dim xlRn As Excel.Range

  Set Doc = Application.ActiveInspector.WordEditor
  Set wdRn = Doc.Range

  Set Xl = GetObject(, "Excel.Application")
  Set Ws = Xl.Workbooks("Mappe1.xls").Worksheets(1)

  Set xlRn = Ws.Range("b2", "c6")
  xlRn.Copy

  wdRn.Paste
End Sub

'untested

 

add info:

The VBA editor is the development environment for your own VBA functions. To open it, press ALT + F11 in Outlook. If necessary, press CTRL + R to display the project explorer. This lists all modules belonging to the project.
Where do I add macros?

At the beginning there is only the module ThisOutlookSession, which you can see under Project1 / Microsoft Office Outlook Objects. Double-click the entry to open the module in the code window. You can copy all macros into this module. This concerns e.g. all of the VBA examples we offer. (In the few exceptions where code belongs in another module, this is pointed out to you.)

Since a code module can accommodate any number of functions or macros, this one module will usually be sufficient. As your code collection grows, it can make sense to move related functions into separate modules. This allows you to improve the overview, but this is not technically necessary.

 

Maybe it will work with VBA

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)