ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro in 2000 (https://www.excelbanter.com/excel-programming/353225-macro-2000-a.html)

Naman.Patel

Macro in 2000
 
I have created Macro in office XP but it doesn't work in Office 2000 because
use of "Application.FileDialog(msoFileDialogFolderPicker) " in XP Macro which
is not supported in Office 2000.

Arvi Laanemets

Macro in 2000
 
Hi

As I don't use OfficeXP, I'm not sure what .. does, but I quess in Excel2000
you can try with
....
fFullName = Application.GetOpenFilename(Title:=fTitle,
FileFilter:=FilterList)


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



"Naman.Patel" wrote in message
...
I have created Macro in office XP but it doesn't work in Office 2000
because
use of "Application.FileDialog(msoFileDialogFolderPicker) " in XP Macro
which
is not supported in Office 2000.




NickHK

Macro in 2000
 
Naman,
Use the SHBrowseForFolder API (or one of the many wrapped in a class). Many
examples from Google.

NickHK

"Naman.Patel" wrote in message
...
I have created Macro in office XP but it doesn't work in Office 2000

because
use of "Application.FileDialog(msoFileDialogFolderPicker) " in XP Macro

which
is not supported in Office 2000.




Naman.Patel[_2_]

Macro in 2000
 
"Arvi Laanemets"

your suggestion might be working but my problem is tha I want to select a
folder from dialog box which can work in both 2000 and XP and I need it's
title my own.

waiting for reply

Thanks for ur help


Arvi Laanemets

Macro in 2000
 
Hi

Is GetOpenFilename() not supported in OfficeXP? Usually they have features
from earlier versions supported - I think it is worth to check with
OfficeXP.


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


"Naman.Patel" wrote in message
...
"Arvi Laanemets"

your suggestion might be working but my problem is tha I want to select a
folder from dialog box which can work in both 2000 and XP and I need it's
title my own.

waiting for reply

Thanks for ur help




NickHK

Macro in 2000
 
Arvi,
I guess it is but the OP wants to select a Folder, not a file.
Hence I suggested the SHBrowseForFolder API.

NickHK

"Arvi Laanemets" wrote in message
...
Hi

Is GetOpenFilename() not supported in OfficeXP? Usually they have features
from earlier versions supported - I think it is worth to check with
OfficeXP.


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


"Naman.Patel" wrote in message
...
"Arvi Laanemets"

your suggestion might be working but my problem is tha I want to select

a
folder from dialog box which can work in both 2000 and XP and I need

it's
title my own.

waiting for reply

Thanks for ur help






kounoike[_2_]

Macro in 2000
 
"Naman.Patel" wrote in message
...
"Arvi Laanemets"

your suggestion might be working but my problem is tha I want to select a
folder from dialog box which can work in both 2000 and XP and I need it's
title my own.


Is this work for you?

Sub test()
Dim str As String
str = getFoldername
MsgBox "folder: " & str
End Sub

Function getFoldername() As String
Dim objShell As Object
Dim ssfWINDOWS As Long
Dim objFolder As Object

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Select folder", 0)
If (Not objFolder Is Nothing) Then
getFoldername = objFolder.Self.Path
Else
getFoldername = ""
End If
Set objFolder = Nothing
Set objShell = Nothing
End Function

keizi


Naman.Patel[_2_]

Macro in 2000
 
How to use shbrowseforfolder api???

I am using VBA enviornoment!!!

"NickHK" wrote:

Naman,
Use the SHBrowseForFolder API (or one of the many wrapped in a class). Many
examples from Google.

NickHK

"Naman.Patel" wrote in message
...
I have created Macro in office XP but it doesn't work in Office 2000

because
use of "Application.FileDialog(msoFileDialogFolderPicker) " in XP Macro

which
is not supported in Office 2000.





Naman.Patel[_2_]

Macro in 2000
 
Thanks,

It is working fine and it has solved my problem.

but I want some more help on it. do u have ne help documents for this? I
need to open the file also..



NickHK

Macro in 2000
 
Naman,
You can still use the Windows API. Get the API-Guide from
http://www.allapi.net/

NickHK

"Naman.Patel" wrote in message
...
How to use shbrowseforfolder api???

I am using VBA enviornoment!!!

"NickHK" wrote:

Naman,
Use the SHBrowseForFolder API (or one of the many wrapped in a class).

Many
examples from Google.

NickHK

"Naman.Patel" wrote in message
...
I have created Macro in office XP but it doesn't work in Office 2000

because
use of "Application.FileDialog(msoFileDialogFolderPicker) " in XP Macro

which
is not supported in Office 2000.







kounoike[_2_]

Macro in 2000
 
documents for BrowseFolder is here

http://msdn.microsoft.com/library/de...eforfolder.asp

and do you want just to open file like from explore or
want to get a file name to open?

if just want to open, then

Sub fnShellExploreVB()
Dim objShell As Object

Set objShell = CreateObject("Shell.Application")
objShell.Explore (0)
Set objShell = Nothing
End Sub

will open the file.

but want to get a file name to open, i think it's better to use
Application.GetOpenFilename like

sub test1()
fileToOpen = Application.GetOpenFilename("all files (*.*), *.*")
If fileToOpen < False Then
MsgBox "select : " & fileToOpen
End If
end sub

keizi

"Naman.Patel" wrote in message
...
Thanks,

It is working fine and it has solved my problem.

but I want some more help on it. do u have ne help documents for this? I
need to open the file also..





All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com