PC Review


Reply
Thread Tools Rate Thread

Copy cells from work book then auto close without losing data

 
 
=?Utf-8?B?QmlnZzE5?=
Guest
Posts: n/a
 
      4th Jun 2007
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
 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      4th Jun 2007
Hi Bigg,

Try replacing:

> ActiveWorkbook.Close SaveChanges:=False


with

Application.CutCopyMode = False
ActiveWorkbook.Close SaveChanges:=False



---
Regards,
Norman


"Bigg19" <(E-Mail Removed)> wrote in message
news1012681-6DCA-42CA-9286-(E-Mail Removed)...
>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



 
Reply With Quote
 
=?Utf-8?B?QmlnZzE5?=
Guest
Posts: n/a
 
      4th Jun 2007
Thanks
I tried it earlier, bit it removes the data from the clipbpoard, and I need
to save it for future pasting.

Bigg19

"Norman Jones" wrote:

> Hi Bigg,
>
> Try replacing:
>
> > ActiveWorkbook.Close SaveChanges:=False

>
> with
>
> Application.CutCopyMode = False
> ActiveWorkbook.Close SaveChanges:=False
>
>
>
> ---
> Regards,
> Norman
>
>
> "Bigg19" <(E-Mail Removed)> wrote in message
> news1012681-6DCA-42CA-9286-(E-Mail Removed)...
> >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

>
>
>

 
Reply With Quote
 
Norman Jones
Guest
Posts: n/a
 
      4th Jun 2007
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



---
Regards,
Norman


 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      4th Jun 2007
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

"Bigg19" <(E-Mail Removed)> wrote in message
news:7CA84D48-BE56-4FB9-954A-(E-Mail Removed)...
> Thanks
> I tried it earlier, bit it removes the data from the clipbpoard, and I

need
> to save it for future pasting.
>
> Bigg19
>
> "Norman Jones" wrote:
>
> > Hi Bigg,
> >
> > Try replacing:
> >
> > > ActiveWorkbook.Close SaveChanges:=False

> >
> > with
> >
> > Application.CutCopyMode = False
> > ActiveWorkbook.Close SaveChanges:=False
> >
> >
> >
> > ---
> > Regards,
> > Norman
> >
> >
> > "Bigg19" <(E-Mail Removed)> wrote in message
> > news1012681-6DCA-42CA-9286-(E-Mail Removed)...
> > >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

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?QmlnZzE5?=
Guest
Posts: n/a
 
      4th Jun 2007
Thanks

Your solution Worked

Regards

Bigg19

"NickHK" wrote:

> 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
>
> "Bigg19" <(E-Mail Removed)> wrote in message
> news:7CA84D48-BE56-4FB9-954A-(E-Mail Removed)...
> > Thanks
> > I tried it earlier, bit it removes the data from the clipbpoard, and I

> need
> > to save it for future pasting.
> >
> > Bigg19
> >
> > "Norman Jones" wrote:
> >
> > > Hi Bigg,
> > >
> > > Try replacing:
> > >
> > > > ActiveWorkbook.Close SaveChanges:=False
> > >
> > > with
> > >
> > > Application.CutCopyMode = False
> > > ActiveWorkbook.Close SaveChanges:=False
> > >
> > >
> > >
> > > ---
> > > Regards,
> > > Norman
> > >
> > >
> > > "Bigg19" <(E-Mail Removed)> wrote in message
> > > news1012681-6DCA-42CA-9286-(E-Mail Removed)...
> > > >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
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?QmlnZzE5?=
Guest
Posts: n/a
 
      4th Jun 2007
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

"Norman Jones" wrote:

> 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
>
>
>
> ---
> Regards,
> Norman
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy work sheet to another work book, pros and cons Withnails Microsoft Excel Programming 1 21st Oct 2009 01:12 PM
AUTO FILTER WITH VALUE IN CELLS AND COPY FILTERED DATA TO NEW FILE Eddy Stan Microsoft Excel Programming 3 23rd Jun 2008 02:15 PM
copy workbook files without losing data that was in the org. work =?Utf-8?B?cnVl?= Microsoft Excel Worksheet Functions 0 24th Oct 2006 09:57 PM
Open book, copy and paste from sheet, and then close.... Darin Kramer Microsoft Excel Programming 5 14th Sep 2006 04:00 PM
close work book via macro Sunil Patel Microsoft Excel Programming 3 7th Jan 2004 09:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:19 AM.