How to unhighlight pasted data

Piglette
Lounger
Posts: 35
Joined: 20 Feb 2010, 05:05

How to unhighlight pasted data

Post by Piglette »

I have some VBS code that pastes a block of data into an invisible Excel 2007 spreadsheet, activates a particular cell, saves and quits.

When the user opens the spreadsheet, they see the pasted data highlighted.

How to use VBS to get rid of the highlight before saving?

Thanks

Lukas

User avatar
HansV
Administrator
Posts: 78668
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How to unhighlight pasted data

Post by HansV »

The Activate method doesn't change the selection, but makes a particular cell within the selection the active cell. You could use the Select method instead of the Activate method to reduce the selection to that particular cell.
Best wishes,
Hans

Piglette
Lounger
Posts: 35
Joined: 20 Feb 2010, 05:05

Re: How to unhighlight pasted data

Post by Piglette »

Thanks!