rupertsland
New Member
- Joined
- Sep 7, 2010
- Messages
- 2
Hello.
I'm trying to generate a VBA procedure in Excel 2003 that would let me open a folder window by clicking on a button in an Excel worksheet.
Here's the code I wrote:
'---------------------------------------------------------------
Public Sub OpenFolder() 'open folder on network
'declare variable:
Dim strFilePath As String
strFilePathCodes = Range("filepath").Value
ActiveWorkbook.Filename = strFilePath
End Sub
'------------------------------------------------------
"Range" is a range name "filepath" that refers to a cell where I store the path to the folder I want to open: D:\Test\
The statement ActiveWorkbook.Filename is obviously wrong, but I can't seem to find the correct statement to actually open the folder. Any suggestions or code that would help me solve my problem?
Sincerely,
Rupertsland
I'm trying to generate a VBA procedure in Excel 2003 that would let me open a folder window by clicking on a button in an Excel worksheet.
Here's the code I wrote:
'---------------------------------------------------------------
Public Sub OpenFolder() 'open folder on network
'declare variable:
Dim strFilePath As String
strFilePathCodes = Range("filepath").Value
ActiveWorkbook.Filename = strFilePath
End Sub
'------------------------------------------------------
"Range" is a range name "filepath" that refers to a cell where I store the path to the folder I want to open: D:\Test\
The statement ActiveWorkbook.Filename is obviously wrong, but I can't seem to find the correct statement to actually open the folder. Any suggestions or code that would help me solve my problem?
Sincerely,
Rupertsland