Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening File Browser

I would like to open a normal Folder (Not a file) in VBA
for browsing files from a path contructed from an array.
If I put path in a cell as a hyperlink I can click on it
and the folder will open. If I try to open the folder fron
a macro I get errors.

I've tried:
Worksheets("SheetName").Range("A2").Hyperlink.Foll ow
NewWindow:=True

I get:
Object doesn't support this property or method

What I am trying to do, is allow a user to open a folder
based on a subject, direct them to the appropriate folder
that contains files pertaining to the subject and allow
them to choose the document they wish.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Opening File Browser

I think the usual way of doing this is to change to the desired drive and
folder and then use GetOpenFilename:

Sub a()
Dim FName As Variant
ChDrive "D"
ChDir "\download"
FName = Application.GetOpenFilename("Excel files (*.xls),*.xls")
If FName < False Then Workbooks.Open FName
End Sub

You'd have to take the path info and put it into the first two lines above.
--
Jim Rech
Excel MVP

"Stoodwalk" wrote in message
...
|I would like to open a normal Folder (Not a file) in VBA
| for browsing files from a path contructed from an array.
| If I put path in a cell as a hyperlink I can click on it
| and the folder will open. If I try to open the folder fron
| a macro I get errors.
|
| I've tried:
| Worksheets("SheetName").Range("A2").Hyperlink.Foll ow
| NewWindow:=True
|
| I get:
| Object doesn't support this property or method
|
| What I am trying to do, is allow a user to open a folder
| based on a subject, direct them to the appropriate folder
| that contains files pertaining to the subject and allow
| them to choose the document they wish.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening File Browser

I do not want to open a file, I want to open a folder so
that a user may select a .pdf file or a word doc or
whatever. The content will vary from subject to subject I
just want to open a browser window at the desired path. A
dialog box will close as soon as you select a file, I want
a browser so it can stay open.

I do apologize for the confusion.
Thank you for your answer I do apreciate it.
-----Original Message-----
I think the usual way of doing this is to change to the

desired drive and
folder and then use GetOpenFilename:

Sub a()
Dim FName As Variant
ChDrive "D"
ChDir "\download"
FName = Application.GetOpenFilename("Excel files

(*.xls),*.xls")
If FName < False Then Workbooks.Open FName
End Sub

You'd have to take the path info and put it into the

first two lines above.
--
Jim Rech
Excel MVP

"Stoodwalk" wrote

in message
...
|I would like to open a normal Folder (Not a file) in VBA
| for browsing files from a path contructed from an array.
| If I put path in a cell as a hyperlink I can click on it
| and the folder will open. If I try to open the folder

fron
| a macro I get errors.
|
| I've tried:
| Worksheets("SheetName").Range("A2").Hyperlink.Foll ow
| NewWindow:=True
|
| I get:
| Object doesn't support this property or method
|
| What I am trying to do, is allow a user to open a folder
| based on a subject, direct them to the appropriate

folder
| that contains files pertaining to the subject and allow
| them to choose the document they wish.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Opening File Browser

I do not want to open a file

My code opened the file as an example of using what the user selected. You
don't have to open. Also you can put any file spec in the macro, PDF, etc.

I just want to open a browser window at the desired path.


What is a "browser window"? Where in Excel did you see one if it's not the
File, Open dialog?

What's the full scenario - the dialog opens, the user clicks a file, then
what?

--
Jim Rech
Excel MVP
"Stoodwalk" wrote in message
...
|I do not want to open a file, I want to open a folder so
| that a user may select a .pdf file or a word doc or
| whatever. The content will vary from subject to subject I
| just want to open a browser window at the desired path. A
| dialog box will close as soon as you select a file, I want
| a browser so it can stay open.
|
| I do apologize for the confusion.
| Thank you for your answer I do apreciate it.
| -----Original Message-----
| I think the usual way of doing this is to change to the
| desired drive and
| folder and then use GetOpenFilename:
|
| Sub a()
| Dim FName As Variant
| ChDrive "D"
| ChDir "\download"
| FName = Application.GetOpenFilename("Excel files
| (*.xls),*.xls")
| If FName < False Then Workbooks.Open FName
| End Sub
|
| You'd have to take the path info and put it into the
| first two lines above.
| --
| Jim Rech
| Excel MVP
|
| "Stoodwalk" wrote
| in message
| ...
| |I would like to open a normal Folder (Not a file) in VBA
| | for browsing files from a path contructed from an array.
| | If I put path in a cell as a hyperlink I can click on it
| | and the folder will open. If I try to open the folder
| fron
| | a macro I get errors.
| |
| | I've tried:
| | Worksheets("SheetName").Range("A2").Hyperlink.Foll ow
| | NewWindow:=True
| |
| | I get:
| | Object doesn't support this property or method
| |
| | What I am trying to do, is allow a user to open a folder
| | based on a subject, direct them to the appropriate
| folder
| | that contains files pertaining to the subject and allow
| | them to choose the document they wish.
|
|
| .
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Opening File Browser

Jim, thanks for rechecking this post.

I may be using the term browser a little too loosely. I
think I mean Windows Explorer or Explorer.exe. The
spreadsheet has a list of products across the top, and
rows that describe options. The "files" are in several
formats a cover a range of subjects, much of it is test
data and reports. The users wish to open the folder and
peruse the contents and will most likely open several
documents but don't want to repeatedly open a dialog box
to open more documents. I thought it would easier if they
could just open the folder that contained the files that
are on the network.

-----Original Message-----
I do not want to open a file


My code opened the file as an example of using what the

user selected. You
don't have to open. Also you can put any file spec in

the macro, PDF, etc.

I just want to open a browser window at the desired

path.

What is a "browser window"? Where in Excel did you see

one if it's not the
File, Open dialog?

What's the full scenario - the dialog opens, the user

clicks a file, then
what?

--
Jim Rech
Excel MVP
"Stoodwalk" wrote

in message
...
|I do not want to open a file, I want to open a folder so
| that a user may select a .pdf file or a word doc or
| whatever. The content will vary from subject to subject

I
| just want to open a browser window at the desired path.

A
| dialog box will close as soon as you select a file, I

want
| a browser so it can stay open.
|
| I do apologize for the confusion.
| Thank you for your answer I do apreciate it.
| -----Original Message-----
| I think the usual way of doing this is to change to the
| desired drive and
| folder and then use GetOpenFilename:
|
| Sub a()
| Dim FName As Variant
| ChDrive "D"
| ChDir "\download"
| FName = Application.GetOpenFilename("Excel files
| (*.xls),*.xls")
| If FName < False Then Workbooks.Open FName
| End Sub
|
| You'd have to take the path info and put it into the
| first two lines above.
| --
| Jim Rech
| Excel MVP
|
| "Stoodwalk" wrote
| in message
| ...
| |I would like to open a normal Folder (Not a file) in

VBA
| | for browsing files from a path contructed from an

array.
| | If I put path in a cell as a hyperlink I can click

on it
| | and the folder will open. If I try to open the folder
| fron
| | a macro I get errors.
| |
| | I've tried:
| | Worksheets("SheetName").Range("A2").Hyperlink.Foll ow
| | NewWindow:=True
| |
| | I get:
| | Object doesn't support this property or method
| |
| | What I am trying to do, is allow a user to open a

folder
| | based on a subject, direct them to the appropriate
| folder
| | that contains files pertaining to the subject and

allow
| | them to choose the document they wish.
|
|
| .
|


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Opening File Browser

So I'm now thinking that your real question is: Hold do I open Windows
Explorer to a specific folder?

This may help if so:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub LaunchWinExplorer()
Dim TargetFolder As String
TargetFolder = "d:\download"
ShellExecute 0, "Open", TargetFolder, "", "C:\", 1
End Sub


--
Jim Rech
Excel MVP


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
Workbooks opening in browser window Richard Excel Discussion (Misc queries) 0 January 17th 07 04:52 PM
Error opening a CSV from Web Browser after changing Region [email protected] Excel Discussion (Misc queries) 0 December 7th 05 08:09 PM
HTML HREF Opening in Browser JanetFan95758 Excel Programming 0 April 26th 04 04:31 AM
Opening browser window Abhay Parekh Excel Programming 1 December 4th 03 08:01 PM
runtime error 1004 when opening excel file via VBA in a browser Ken Hunter Excel Programming 2 July 31st 03 03:33 PM


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