Excel copy crop data to clipboard

I created a web application with an insert button to populate the table. The data was originally copied from an Excel spreadsheet and pasted into my form.

The problem is that I only see the displayed data, not the base values. For example, if the cell value is 12.223, and the cell format shows only 12.2, 12.2 goes to the clipboard.

Did I miss the trick here? Does anyone know how to pull full data from clipboard?

Edit: It looks like Excel is making 25 different formats available on the clipboard, including the β€œXML Spreadsheet”, which looks like it contains the actual information I need. However, it appears that only the text version is available in the browser. Is there an ActiveX control or something similar that I can use to capture this data?

+3
source share
4 answers

The only way I can do this is to get down the VBA code that uses the Windows Forms object library.

I found sample code that uses the clipboard

http://www.dailydoseofexcel.com/archives/2004/12/02/putting-text-into-the-windows-clipboard/

. ,

cell.Text

to

cell.Value

, , , .

EDIT:

, , ok

+5

, , "-", "" "". .

0

, , ,

Sub CopyPasteSpecialCopy()

    'Clear out temp destination
    Sheets("CopyPasteSheet").Select
    Cells.Select
    Selection.ClearContents

    'Copy data
    Sheets("DataSheet").Select
    Cells.Select
    Application.CutCopyMode = False
    Selection.Copy

    'Paste data
    Sheets("CopyPasteSheet").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Cells.Select
    Application.CutCopyMode = False

    'Put it onto the clipboard
    Selection.Copy

End Sub

XML.

, Ctrl + C.

0

, Excel, , . , Windows -, . - , , .

ActiveX , , , , excel. javascript , .

0

Source: https://habr.com/ru/post/1714778/


All Articles