Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Re-show userform after closing file - code help

Need a little help with some code. In one file, I have a userform with a
drop-down combobox from which a user selects an existing file to open. After
the file is opened, the userform is hid using me.hide. After making updates
to the file opened using the form, I need code to save the changes and
re-show the userform in the original file so the user can make another
selection or exit the userform.

Your help would be greatly appreciated!
--
Thanks,

Gerry O.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Re-show userform after closing file - code help

A little hard to comment without seeing any code however in general (assuming
you are not using workbook objects)

ActiveWorkbook.Save 'Saves the currently acitve book
UserForm1.Show 'shows the userform that you hid
ThisWorkbook.Activate 'brings back the workbbok running the code...

Note that if the code is all being run from the userform you could use

Me.Show to bring back the userform.
--
HTH...

Jim Thomlinson


"Gerry O" wrote:

Need a little help with some code. In one file, I have a userform with a
drop-down combobox from which a user selects an existing file to open. After
the file is opened, the userform is hid using me.hide. After making updates
to the file opened using the form, I need code to save the changes and
re-show the userform in the original file so the user can make another
selection or exit the userform.

Your help would be greatly appreciated!
--
Thanks,

Gerry O.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Re-show userform after closing file - code help

I'd swap those last two:

ActiveWorkbook.Save 'Saves the currently acitve book
ThisWorkbook.Activate 'brings back the workbbok running the code...
UserForm1.Show 'shows the userform that you hid



Jim Thomlinson wrote:

A little hard to comment without seeing any code however in general (assuming
you are not using workbook objects)

ActiveWorkbook.Save 'Saves the currently acitve book
UserForm1.Show 'shows the userform that you hid
ThisWorkbook.Activate 'brings back the workbbok running the code...

Note that if the code is all being run from the userform you could use

Me.Show to bring back the userform.
--
HTH...

Jim Thomlinson

"Gerry O" wrote:

Need a little help with some code. In one file, I have a userform with a
drop-down combobox from which a user selects an existing file to open. After
the file is opened, the userform is hid using me.hide. After making updates
to the file opened using the form, I need code to save the changes and
re-show the userform in the original file so the user can make another
selection or exit the userform.

Your help would be greatly appreciated!
--
Thanks,

Gerry O.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Re-show userform after closing file - code help

Thanks! That helped solve.
--
Thanks,

Gerry O.


"Jim Thomlinson" wrote:

A little hard to comment without seeing any code however in general (assuming
you are not using workbook objects)

ActiveWorkbook.Save 'Saves the currently acitve book
UserForm1.Show 'shows the userform that you hid
ThisWorkbook.Activate 'brings back the workbbok running the code...

Note that if the code is all being run from the userform you could use

Me.Show to bring back the userform.
--
HTH...

Jim Thomlinson


"Gerry O" wrote:

Need a little help with some code. In one file, I have a userform with a
drop-down combobox from which a user selects an existing file to open. After
the file is opened, the userform is hid using me.hide. After making updates
to the file opened using the form, I need code to save the changes and
re-show the userform in the original file so the user can make another
selection or exit the userform.

Your help would be greatly appreciated!
--
Thanks,

Gerry O.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform won't show when file re-opened Gerry O Excel Discussion (Misc queries) 2 September 4th 07 05:42 PM
How to code on Macro on saving and closing a file? Eric Excel Worksheet Functions 1 June 10th 07 01:32 PM
Resume.xlw and closing workbook with VBA code. BruceS Excel Discussion (Misc queries) 6 November 4th 06 08:19 PM
Properties window show nothing for a userform Cheer-Phil-ly Excel Discussion (Misc queries) 0 July 27th 06 07:15 PM
Closing the VBA Editor using code Bony_Pony Excel Worksheet Functions 1 March 7th 05 08:14 PM


All times are GMT +1. The time now is 01:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"