#1   Report Post  
aftamath
 
Posts: n/a
Default Close a Folder

Here is the VBA code used to open a folder from a command button;

Private Sub Go1_Click()

ActiveWorkbook.FollowHyperlink Address:="D:\Documents and
Settings\Desktop\Products\" & ComboBox1, _
NewWindow:=True

ActiveWorkbook.Address("D:\Documents and Settings\Michael
Groll\Desktop\Products\Honeywell").Close

End Sub

The second item in the code isn't correct at all for closing the folder. Is
it possible with VBA and, if so, how do I write the code. Thanks
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Activeworkbook.Close

--
HTH

Bob Phillips

"aftamath" wrote in message
...
Here is the VBA code used to open a folder from a command button;

Private Sub Go1_Click()

ActiveWorkbook.FollowHyperlink Address:="D:\Documents and
Settings\Desktop\Products\" & ComboBox1, _
NewWindow:=True

ActiveWorkbook.Address("D:\Documents and Settings\Michael
Groll\Desktop\Products\Honeywell").Close

End Sub

The second item in the code isn't correct at all for closing the folder.

Is
it possible with VBA and, if so, how do I write the code. Thanks



  #3   Report Post  
aftamath
 
Posts: n/a
Default

I don't want to close the workbook I'm working in. I want to close the
folder I just opened using the first codeline.

"Bob Phillips" wrote:

Activeworkbook.Close

--
HTH

Bob Phillips

"aftamath" wrote in message
...
Here is the VBA code used to open a folder from a command button;

Private Sub Go1_Click()

ActiveWorkbook.FollowHyperlink Address:="D:\Documents and
Settings\Desktop\Products\" & ComboBox1, _
NewWindow:=True

ActiveWorkbook.Address("D:\Documents and Settings\Michael
Groll\Desktop\Products\Honeywell").Close

End Sub

The second item in the code isn't correct at all for closing the folder.

Is
it possible with VBA and, if so, how do I write the code. Thanks




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

You don't open a folder, you open workbooks or files. You reference folders.
Thus, you cannot close something that is not opened.

--
HTH

Bob Phillips

"aftamath" wrote in message
...
I don't want to close the workbook I'm working in. I want to close the
folder I just opened using the first codeline.

"Bob Phillips" wrote:

Activeworkbook.Close

--
HTH

Bob Phillips

"aftamath" wrote in message
...
Here is the VBA code used to open a folder from a command button;

Private Sub Go1_Click()

ActiveWorkbook.FollowHyperlink Address:="D:\Documents and
Settings\Desktop\Products\" & ComboBox1, _
NewWindow:=True

ActiveWorkbook.Address("D:\Documents and Settings\Michael
Groll\Desktop\Products\Honeywell").Close

End Sub

The second item in the code isn't correct at all for closing the

folder.
Is
it possible with VBA and, if so, how do I write the code. Thanks






  #5   Report Post  
aftamath
 
Posts: n/a
Default

This code opens a folder in a new window. ComboBox1 is a string selected by
the user to open a folder. I know that it opens a folder because I ran it
and it works. The folder opens up right on the screen. Perhaps there's
isn't a code to close the non-application specific folder.

"Bob Phillips" wrote:

You don't open a folder, you open workbooks or files. You reference folders.
Thus, you cannot close something that is not opened.

--
HTH

Bob Phillips

"aftamath" wrote in message
...
I don't want to close the workbook I'm working in. I want to close the
folder I just opened using the first codeline.

"Bob Phillips" wrote:

Activeworkbook.Close

--
HTH

Bob Phillips

"aftamath" wrote in message
...
Here is the VBA code used to open a folder from a command button;

Private Sub Go1_Click()

ActiveWorkbook.FollowHyperlink Address:="D:\Documents and
Settings\Desktop\Products\" & ComboBox1, _
NewWindow:=True

ActiveWorkbook.Address("D:\Documents and Settings\Michael
Groll\Desktop\Products\Honeywell").Close

End Sub

The second item in the code isn't correct at all for closing the

folder.
Is
it possible with VBA and, if so, how do I write the code. Thanks








  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

What is the name of this 'folder' that it opens, and what exactly do you
mean by 'open'?

--
HTH

Bob Phillips

"aftamath" wrote in message
...
This code opens a folder in a new window. ComboBox1 is a string selected

by
the user to open a folder. I know that it opens a folder because I ran it
and it works. The folder opens up right on the screen. Perhaps there's
isn't a code to close the non-application specific folder.

"Bob Phillips" wrote:

You don't open a folder, you open workbooks or files. You reference

folders.
Thus, you cannot close something that is not opened.

--
HTH

Bob Phillips

"aftamath" wrote in message
...
I don't want to close the workbook I'm working in. I want to close

the
folder I just opened using the first codeline.

"Bob Phillips" wrote:

Activeworkbook.Close

--
HTH

Bob Phillips

"aftamath" wrote in message
...
Here is the VBA code used to open a folder from a command button;

Private Sub Go1_Click()

ActiveWorkbook.FollowHyperlink Address:="D:\Documents and
Settings\Desktop\Products\" & ComboBox1, _
NewWindow:=True

ActiveWorkbook.Address("D:\Documents and Settings\Michael
Groll\Desktop\Products\Honeywell").Close

End Sub

The second item in the code isn't correct at all for closing the

folder.
Is
it possible with VBA and, if so, how do I write the code. Thanks








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
file folder macro's shrek Links and Linking in Excel 3 September 16th 05 10:17 PM
"Save As" folder -- can I default this to the same folder as origi Mike Excel Discussion (Misc queries) 1 June 11th 05 12:06 AM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
What is folder OLK7 and where can I find it? HELP! Excel Discussion (Misc queries) 1 April 1st 05 05:35 AM
How can I change the appearance of the folder icon Margie Excel Discussion (Misc queries) 4 December 29th 04 02:41 PM


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