Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

clipboard

Discussion in 'Information Technology' started by Kate, Jul 28, 2006.

Tags:
  1. Kate

    Kate
    Expand Collapse
    Guest

    Hello,
    I have a whole pile of VBA code in access, which does lots of stuff,
    then opens excel and runs two macros. These macros involve a lot of
    reformatting and cut and paste. Each time I run it in access, it asks
    if I want to save the data to the clipboard. I don't, and I also don't
    want it to keep asking me each time I run it. How do I make this
    prompt go away?

    Thanks
     
  2. Arvin Meyer [MVP]

    Arvin Meyer [MVP]
    Expand Collapse
    Guest

    Really an Excel question, but since you're using automation, I'll answer it
    (hopefully correctly)

    Excel has a Saved property that can be set to True to avoid prompting, even
    when it's false:

    the code is something like:

    ' ... yada yada
    wkb.Saved = True
    --
    Arvin Meyer, MCP, MVP
    Microsoft Access
    Free Access downloads
    http://www.datastrat.com
    http://www.mvps.org/access

    "Kate" <ktm19@student.canterbury.ac.nz> wrote in message
    news:1150060250.116053.6360@f6g2000cwb.googlegroups.com...
    > Hello,
    > I have a whole pile of VBA code in access, which does lots of stuff,
    > then opens excel and runs two macros. These macros involve a lot of
    > reformatting and cut and paste. Each time I run it in access, it asks
    > if I want to save the data to the clipboard. I don't, and I also don't
    > want it to keep asking me each time I run it. How do I make this
    > prompt go away?
    >
    > Thanks
    >
     
  3. Larry Daugherty

    Larry Daugherty
    Expand Collapse
    Guest

    That message is likely coming from Excel as you are closing workbooks.
    With the command to close you can pass a nosave flag that will cause
    it to close silently.

    HTH
    --
    -Larry-
    --

    "Kate" <ktm19@student.canterbury.ac.nz> wrote in message
    news:1150060250.116053.6360@f6g2000cwb.googlegroups.com...
    > Hello,
    > I have a whole pile of VBA code in access, which does lots of stuff,
    > then opens excel and runs two macros. These macros involve a lot of
    > reformatting and cut and paste. Each time I run it in access, it

    asks
    > if I want to save the data to the clipboard. I don't, and I also

    don't
    > want it to keep asking me each time I run it. How do I make this
    > prompt go away?
    >
    > Thanks
    >
     
  4. Kate

    Kate
    Expand Collapse
    Guest

    Yes that is right. I am closing workbooks. Can you be more specific
    about how to pass a nosave flag?

    Thanks
     
  5. RoyVidar

    RoyVidar
    Expand Collapse
    Guest

    Kate wrote in message
    <1150060250.116053.6360@f6g2000cwb.googlegroups.com> :
    > Hello,
    > I have a whole pile of VBA code in access, which does lots of stuff,
    > then opens excel and runs two macros. These macros involve a lot of
    > reformatting and cut and paste. Each time I run it in access, it
    > asks if I want to save the data to the clipboard. I don't, and I
    > also don't want it to keep asking me each time I run it. How do I
    > make this prompt go away?
    >
    > Thanks


    Try setting your Excel application objects CutCopyMode property to
    false

    --
    Roy-Vidar
     
  6. Kate

    Kate
    Expand Collapse
    Guest

    Sorry to be slow, but is that a command i write in VBA?
    CutCopyMode=False
    Clearly I havent got it right cos it doesnt work! Do I need to select
    something first? Presumably it goes after hte paste, but before the
    close sheet?
     
  7. RoyVidar

    RoyVidar
    Expand Collapse
    Guest

    Kate wrote in message
    <1150682252.710998.264630@i40g2000cwc.googlegroups.com> :
    > Sorry to be slow, but is that a command i write in VBA?
    > CutCopyMode=False
    > Clearly I havent got it right cos it doesnt work! Do I need to
    > select something first? Presumably it goes after hte paste, but
    > before the close sheet?


    CutCopyMode is a property of the Excel application. So, if your Excel
    application object is called xl, then

    xl.CutCopyMode = false

    just before you're closing the workbook.

    --
    Roy-Vidar
     
  8. Kate

    Kate
    Expand Collapse
    Guest

    Terrific, thank you.
    It turned out that I hadn't given the application a name, so I had to
    go
    "Application.CutCopyMode=False"

    Then, I had been trying to enter that code when the workbook to be
    closed was selected as opposed to the one I just pasted into selected.
    All sussed now.
    Thanks
     

Share This Page