Paste as string in Excel Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
PIJUS_MAGINIFICUS
Posts: 4
Joined: 20 Oct 2018, 06:29

Paste as string in Excel

Post by PIJUS_MAGINIFICUS » 10 Feb 2022, 12:29


Hi, I have made a simple script that copy in PDF a number and paste it in excel (no via COM), just to use it in maths op.
But, the issue is that now and then it paste the number as text.
Does anyone knows how to fix this bug?.

Thank you.

RussF
Posts: 1264
Joined: 05 Aug 2021, 06:36

Re: Paste as string in Excel

Post by RussF » 10 Feb 2022, 12:37

It could be that when you are copying the text (either manually or via script), you are inadvertently catching a Space character either before or after the number. That would probably be interpreted by Excel as text.

Russ

PIJUS_MAGINIFICUS
Posts: 4
Joined: 20 Oct 2018, 06:29

Re: Paste as string in Excel

Post by PIJUS_MAGINIFICUS » 10 Feb 2022, 19:46

Thank you.

Miristegal
Posts: 11
Joined: 11 Feb 2022, 06:39

Re: Paste as string in Excel  Topic is solved

Post by Miristegal » 12 Feb 2022, 02:20

Try to trim the clipboard before paste

Code: Select all

;Autohotkey v1:
clipboard := Trim(clipboard)

Code: Select all

;Autohotkey v2:
A_Clipboard := Trim(A_Clipboard)

Moderator edit: Added [code][/code] tags.


Post Reply

Return to “Ask for Help (v1)”