#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Open a Folder

I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Open a Folder

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Echo WshShell.CurrentDirectory
WshShell.CurrentDirectory = "J:\Backup\bBackup"


"danpt" wrote:

I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Open a Folder

Hi, Marvin
It is not quite working.
WScript needs to be defined.
I don't know how. Please take a look again.
Thanks


"Marvin P. Winterbottom" wrote:

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Echo WshShell.CurrentDirectory
WshShell.CurrentDirectory = "J:\Backup\bBackup"


"danpt" wrote:

I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 284
Default Open a Folder

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just wanting
an Explorer type window opening to reveal the contents of the bBackup folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Open a Folder

Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just wanting
an Explorer type window opening to reveal the contents of the bBackup folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Open a Folder

If you just want to review the contents of a folder, you could use
application.getopenfilename or application.getsaveasfilename



danpt wrote:

Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just wanting
an Explorer type window opening to reveal the contents of the bBackup folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks





--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Open a Folder

As long as you don't want your code to interact with Windows Explorer, you
should be able to open it using this...

Shell "explorer.exe", vbNormalFocus

--
Rick (MVP - Excel)


"danpt" wrote in message
...
Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just
wanting
an Explorer type window opening to reveal the contents of the bBackup
folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup,
J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Open a Folder

Thank you very much, Rick
Shell "explorer.exe J:\Backup\bBackup", vbNormalFocus
which is what I wanted.

"Rick Rothstein" wrote:

As long as you don't want your code to interact with Windows Explorer, you
should be able to open it using this...

Shell "explorer.exe", vbNormalFocus

--
Rick (MVP - Excel)


"danpt" wrote in message
...
Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just
wanting
an Explorer type window opening to reveal the contents of the bBackup
folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup,
J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks





  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Open a Folder

Hi Dave,
It opens to dialog window "Documents".
How about "J:\Backup\bBackup" instead.

"Dave Peterson" wrote:

If you just want to review the contents of a folder, you could use
application.getopenfilename or application.getsaveasfilename



danpt wrote:

Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just wanting
an Explorer type window opening to reveal the contents of the bBackup folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks




--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Open a Folder

Dim myPath As String
Dim SavedPath As String

SavedPath = CurDir
myPath = "J:\Backup\bBackup"

ChDrive myPath
ChDir myPath

Application.GetOpenFilename

ChDrive SavedPath
ChDir SavedPath

danpt wrote:

Hi Dave,
It opens to dialog window "Documents".
How about "J:\Backup\bBackup" instead.

"Dave Peterson" wrote:

If you just want to review the contents of a folder, you could use
application.getopenfilename or application.getsaveasfilename



danpt wrote:

Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just wanting
an Explorer type window opening to reveal the contents of the bBackup folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks




--

Dave Peterson


--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Open a Folder

Thank you very much, Dave
I learn something new

"Dave Peterson" wrote:

Dim myPath As String
Dim SavedPath As String

SavedPath = CurDir
myPath = "J:\Backup\bBackup"

ChDrive myPath
ChDir myPath

Application.GetOpenFilename

ChDrive SavedPath
ChDir SavedPath

danpt wrote:

Hi Dave,
It opens to dialog window "Documents".
How about "J:\Backup\bBackup" instead.

"Dave Peterson" wrote:

If you just want to review the contents of a folder, you could use
application.getopenfilename or application.getsaveasfilename



danpt wrote:

Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just wanting
an Explorer type window opening to reveal the contents of the bBackup folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup, J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
Thanks




--

Dave Peterson


--

Dave Peterson

  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Open a Folder

Hello
What if you wanted to make J:\Backup\Backup a user defined location, say it
is defined by a value in a cell of a spreadsheet:
Exa - cell B3 = "J:\Backup\Backup "

I tried
mypath=cell(3,2)
Shell "explorer.exe mypath", vbNormalFocus

it says mypath is not a directory

thanks a bunch



"danpt" wrote:

Thank you very much, Rick
Shell "explorer.exe J:\Backup\bBackup", vbNormalFocus
which is what I wanted.

"Rick Rothstein" wrote:

As long as you don't want your code to interact with Windows Explorer, you
should be able to open it using this...

Shell "explorer.exe", vbNormalFocus

--
Rick (MVP - Excel)


"danpt" wrote in message
...
Hi, Steve
I just want to open an Explorer type window to reveal the contents of the
bBackup folder.

"Steve Yandl" wrote:

Define what you mean by "open the bBackup folder". Are you wanting the
SaveAs dialog to appear opened to the bBackup folder or are you just
wanting
an Explorer type window opening to reveal the contents of the bBackup
folder
or something else?

Steve Yandl


"danpt" wrote in message
...
I backup different xls file groups in J:\Backup\aBackup,
J:\Backup\bBackup
and so on.
Please help me to scripte a vba that will open the bBackup folder.
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
can anyone tell me how to set excel to open to a specific folder bdc1952 Excel Discussion (Misc queries) 1 March 20th 08 05:14 PM
VBA - open folder Jeff Excel Discussion (Misc queries) 1 March 23rd 07 01:33 AM
Can't Open Certain Excel Files in Folder Charles A C Excel Discussion (Misc queries) 2 March 23rd 07 12:02 AM
open and save an entire folder SusanWS Excel Discussion (Misc queries) 1 June 15th 06 03:56 PM
Unable to open a file from its icon in folder John Excel Discussion (Misc queries) 4 February 14th 06 02:02 AM


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