Copy cells from work book then auto close without losing data

B

Bigg19

I am trying to prepare a Workbook for people who don't use excel much. I
need it to open a CSV file, manipulate the data, copy cells and then close
the file before pasting without user input.
So Far I can open the file, manipulate the data, copy the data and close the
file using
"ActiveWorkbook.Close SaveChanges:=False"
But I don't know how to bypass the popup asking if I want to keep the data
on the clipboard.
Thanks in Advance
 
B

Bigg19

Thanks
I tried it earlier, bit it removes the data from the clipbpoard, and I need
to save it for future pasting.

Bigg19
 
N

Norman Jones

Hi Bigg,


'----------------
I tried it earlier, bit it removes the data from the clipbpoard, and I need
to save it for future pasting.
'----------------

Try:

Application.DisplayAlerts = False
ThisWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True
 
N

NickHK

Application.displayalerts=false
'...code
Application.displayalerts=true

However, I would normally copy/paste, then continue with other code, rather
than expecting clipboard data to remain unchanged over time.

NickHK
 
B

Bigg19

Thanks

Your solution Worked

Regards

Bigg19

NickHK said:
Application.displayalerts=false
'...code
Application.displayalerts=true

However, I would normally copy/paste, then continue with other code, rather
than expecting clipboard data to remain unchanged over time.

NickHK
 
B

Bigg19

Thanks

That did the trick, only I had to use ActiveWorkbook.Savechanges= False.
When I tried ThisWorkbook.Savechanges = False, it closed my destination
workbook (from which the macro was being run)

Bigg19
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top