S
S
Sergey2017-03-07 06:06:21
System administration
Sergey, 2017-03-07 06:06:21

How to get rid of 1s artifacts when copying to Excel?

In short, I'm already a little tired of the situation. Ours copy the positions of the goods and paste them into Excel. The file size starts to get bigger and bigger every time. Found artifacts in the form of a TextBox. In is not visible. BUT they exist and there are many. Solved the problem of cleaning documents with a script.

Sub DeleteAllTextBox()
Dim oSh As Shape
For Each oSh In ActiveSheet.Shapes
oSh.Delete
Next oSh
End Sub

BUT how to get rid of the problem in general?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Axian Ltd., 2017-03-07
@AxianLTD

Upload data from 1C to Excel with processing that will unload only what you need. And if a person has accumulated pastil, then this is his personal human problem. Technological discipline should be.

V
VMesser, 2017-03-07
@VMesser

In increasing complexity:
1. If this is the same file, then your sub can be launched from the Worksheet_Change handler, or even hung on Workbook_Open. The main thing is to enable all macros on machines.
2. Ask to paste by right clicking, choosing Text only
3. Collective lobotomy.

K
Konstantin, 2017-03-07
@fosihas

In short, I'm already a little tired of the situation. Ours copy the positions of the goods and paste them into Excel.

And why do they do it?
Maybe, as AxianLTD wrote, it can solve the problem on the 1s side. You don't have to copy-paste to Excel to make a "correct" report/processing.

D
Dmitry Kinash, 2017-03-07
@Dementor

I have never done this, but is it difficult to implement this macro of yours into user templates (it seems normal.dotm), so that the copy-paste event is caught by itself and all inserted Shapes are automatically deleted?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question