Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default two small questions


1. How would I write this code? I need a workbook to not close using
the X in the top right corner. I want it to put up an error message
saying to use the Exit button. I know how to do the message box, but
when I try using the beforeclose call, I cant figure out how to write
code to stop the procedure once it's started. just a plain exit sub
doesnt work...

and

2. Is there a way, to have a textbox, that the user will click on a
button next to it, and it will open up a "explorer" box for them to
search for a file. Basically, I need something that will let them
select a file, and it's going to put the direct link (C:\windows\...)
in a textbox. Is this possible? I'm sure it is, I just don't know how
to do it.

Thanks everyone for your help...


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=500430

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default two small questions

First one:
Cancel = True

Second one:
Lookup this one in the help: Application.GetOpenFilename

RBS

"dok112" wrote in
message ...

1. How would I write this code? I need a workbook to not close using
the X in the top right corner. I want it to put up an error message
saying to use the Exit button. I know how to do the message box, but
when I try using the beforeclose call, I cant figure out how to write
code to stop the procedure once it's started. just a plain exit sub
doesnt work...

and

2. Is there a way, to have a textbox, that the user will click on a
button next to it, and it will open up a "explorer" box for them to
search for a file. Basically, I need something that will let them
select a file, and it's going to put the direct link (C:\windows\...)
in a textbox. Is this possible? I'm sure it is, I just don't know how
to do it.

Thanks everyone for your help...


--
dok112
------------------------------------------------------------------------
dok112's Profile:
http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=500430


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default two small questions


thanks for the answer to the first one.

for 2, I dont want it to open the file. I just want it to put the path
for it. What I'm trying to do, is write a macro that is going to run
down a list of these and email the file at that path to the person in
A1....


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=500430

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default two small questions


I GOT IT!! WOO HOO!! Thank you!!


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=500430

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default two small questions

You don't have to open the file and you can just get the file path:

strFilePath = _
Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt",
_
Title:="Point to a text file")

MsgBox strFilePath

You also could use this one:

vDialogResult = _
Application.GetSaveAsFilename(InitialFileName:=str DefaultFilePath, _
FileFilter:="Text Files (*.txt),
*.txt")


RBS

"dok112" wrote in
message ...

thanks for the answer to the first one.

for 2, I dont want it to open the file. I just want it to put the path
for it. What I'm trying to do, is write a macro that is going to run
down a list of these and email the file at that path to the person in
A1....


--
dok112
------------------------------------------------------------------------
dok112's Profile:
http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=500430


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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
New Questions.. message box too small Nastech Excel Discussion (Misc queries) 1 November 8th 08 07:11 PM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
2 Small VBA Questions; Text To Columns and Naming First Sheet Brent E Excel Discussion (Misc queries) 6 May 2nd 07 07:43 PM
ISERROR,SMALL,INDEX, MATCH, SMALL?? M.A.Tyler Excel Discussion (Misc queries) 1 May 2nd 07 04:08 AM


All times are GMT +1. The time now is 02:19 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"