#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default beforeclose

need help out of starting gate
Useing beforeclose want to ask used where to save would like to have a
userform with choices before I get into this does it seem the right way to go
or has someone been there befor with a better solution? I think doing it in
this manner different drives should be abled.
Thank You
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default beforeclose

Curt wrote:
need help out of starting gate
Useing beforeclose want to ask used where to save would like to have a
userform with choices before I get into this does it seem the right way to go
or has someone been there befor with a better solution? I think doing it in
this manner different drives should be abled.
Thank You


Hi Curt,

If you want to limit save locations to a fixed list of relatively few
options, you could place a ComboBox (or ListBox) on the form and
populate it at runtime. Then you obtain the user's selection when they
click "Save" or whatever and translate the result into a pathname.

The code for this is simple, but the down-side is the list must be
maintained in code. That said, there are ways to make this method
dynamic by looking for the values in an external source.

Form_Initialize:
Combobox1.additem "Location 1"
Combobox1.additem "Location 2"

cmdSave_click():
Select Case Combobox1.Value
Case "Location 1"
MyPath = "C:\UserDocs\"
Case "Location 2"
MyPath = "\\server\share\UserPath\"
End Select


Alternatively, if you would rather allow the user to browse for a
location, you can invoke the Windows Save dialog. It's been some time
since I used this so offhand I don't remember how but I'm sure I (or
someone) can dig it up.
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
BeforeClose Event LeAnn Excel Programming 1 March 21st 08 11:10 PM
BeforeClose running twice Trefor Excel Programming 9 December 21st 07 01:38 AM
BeforeClose vs Auto_Close [email protected] Excel Programming 16 June 3rd 05 10:06 PM
Workbook BeforeClose Bug John Camburn Excel Programming 0 July 9th 04 09:29 PM
BeforeClose Dilemma J. Cornor Excel Programming 0 June 21st 04 07:39 PM


All times are GMT +1. The time now is 08:46 PM.

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"