Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a new workbook in the background (2000/sp3)

    I've been able to answer several of my own questions using the search engine, but can't seem to find the right search terms to answer this question... maybe y'all can help?

    I've got a "master" spreadsheet with tons of data on multiple sheets, yadda-yadda-yadda.

    My boss has now genereated a request to have some of these sheets as they apply to some of his projects. But I don't want to give the whole workbook.

    So I've created some code to export the activesheet to a new workbook, remove all the VBA code (thanks to this forum), and I've managed to save it as a filename without prompting (also thanks to this forum).

    The only detail left is that when I click the cmdExport button to perform all these tasks, the screen flashes around as it whips up a new workbook, performs the worksheet copy, makes the changes, and then saves & closes it. I would like all of that to occur in the background, not the foreground.

    Surely this must be extremely simple.... just can't find it.

    thanks!
    ..dane

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Creating a new workbook in the background (200

    Dane,
    Have you tried adding
    <pre>Application.Screenupdating = False</pre>

    to the beginning of your code and then
    <pre>Application.Screenupdating = True</pre>

    to the end? This should eliminate the screen flicker.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a new workbook in the background (200

    Thanks -- that worked great!

    There sure are lots of settings in the "Application" object. I've not studied it much. I think it's time...

    thanks again.
    ..dane

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •