Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there any way to set (and unset) the File Type name through excel VBA?
I want to list all DWG files in a directory and make hyperlinks to them, but the problem is that different operating systems will use different file type names e.g. some may be "Autocad 14 Drawing" where AutoCAD version 14 is installed while others simply "DWG File" where no AutoCAD system is installed. It would difficult to know what the file type is named as on these other systems. Any ideas of a way round this? Dylan Dawson Scotland |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No sure I follow, but does this do what you want :
Dim ACadFiles As variant acadfiles = Application.GetOpenFilename("AutoCad File (*.dwg;*.dwf),*.dwg;*.dwf", , "Select the AutoCad Files", , True) if isarray(acadfile) then '...etc Change the file type filter to those used by AutoCad Note this does not open the files; onlt returns an array of filename for you do what you wish. Or you just want the user to choose a folder and then you process the files in that folder yourself, look at the SHBrowseForFolder API. http://vbnet.mvps.org/code/browse/browsefolders.htm NickHK "DDawson" wrote in message ... Is there any way to set (and unset) the File Type name through excel VBA? I want to list all DWG files in a directory and make hyperlinks to them, but the problem is that different operating systems will use different file type names e.g. some may be "Autocad 14 Drawing" where AutoCAD version 14 is installed while others simply "DWG File" where no AutoCAD system is installed. It would difficult to know what the file type is named as on these other systems. Any ideas of a way round this? Dylan Dawson Scotland |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nick,
I should have included code as info, the project contains a Loopfolders Function which starts with: Function LoopFolders(startPath As String, _ Optional filetype As String = "AutoCAD 14 Drawing", _ Optional subfolders As Boolean = True) ' Create named Ranges, for the appropriate columns in Row 8 of Worksheet etc.. [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "Microsoft Excel Worksheet" The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't see how/where you are using the filetype "AutoCAD 14 Drawing".
What are you calling with this string ? NickHK "DDawson" wrote in message ... Nick, I should have included code as info, the project contains a Loopfolders Function which starts with: Function LoopFolders(startPath As String, _ Optional filetype As String = "AutoCAD 14 Drawing", _ Optional subfolders As Boolean = True) ' Create named Ranges, for the appropriate columns in Row 8 of Worksheet etc.. [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "Microsoft Excel Worksheet" The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nick,
I did it again, sorry Monday mornings. the second part should be: [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "AutoCAD 14 Drawing" ' Not "Microsoft Excel Worksheet" as previously denoted The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan "NickHK" wrote: I don't see how/where you are using the filetype "AutoCAD 14 Drawing". What are you calling with this string ? NickHK "DDawson" wrote in message ... Nick, I should have included code as info, the project contains a Loopfolders Function which starts with: Function LoopFolders(startPath As String, _ Optional filetype As String = "AutoCAD 14 Drawing", _ Optional subfolders As Boolean = True) ' Create named Ranges, for the appropriate columns in Row 8 of Worksheet etc.. [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "Microsoft Excel Worksheet" The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The free "List Files" Excel add-in will list all files in a folder/subfolders
meeting a specified requirement... *.dwg for instance. Hyperlinks are included. Download from ... http://www.realezsites.com/bus/primitivesoftware No registration required. -- Jim Cone San Francisco, USA "DDawson" wrote in message Is there any way to set (and unset) the File Type name through excel VBA? I want to list all DWG files in a directory and make hyperlinks to them, but the problem is that different operating systems will use different file type names e.g. some may be "Autocad 14 Drawing" where AutoCAD version 14 is installed while others simply "DWG File" where no AutoCAD system is installed. It would difficult to know what the file type is named as on these other systems. Any ideas of a way round this? Dylan Dawson Scotland |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can't help you yet, as I do not know why you need to use file types like
"AutoCAD 14 Drawing". I would have thought using the file extension (*.dwg) would be sufficient. If so, see Jim's post. If not, explain why you need to work such strings. NickHK "DDawson" wrote in message ... Nick, I did it again, sorry Monday mornings. the second part should be: [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "AutoCAD 14 Drawing" ' Not "Microsoft Excel Worksheet" as previously denoted The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan "NickHK" wrote: I don't see how/where you are using the filetype "AutoCAD 14 Drawing". What are you calling with this string ? NickHK "DDawson" wrote in message ... Nick, I should have included code as info, the project contains a Loopfolders Function which starts with: Function LoopFolders(startPath As String, _ Optional filetype As String = "AutoCAD 14 Drawing", _ Optional subfolders As Boolean = True) ' Create named Ranges, for the appropriate columns in Row 8 of Worksheet etc.. [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "Microsoft Excel Worksheet" The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you need to work with File types like this, may Ivan's code can help:
http://www.xcelfiles.com/ShellFileType.html NickHK "DDawson" wrote in message ... Nick, I did it again, sorry Monday mornings. the second part should be: [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "AutoCAD 14 Drawing" ' Not "Microsoft Excel Worksheet" as previously denoted The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan "NickHK" wrote: I don't see how/where you are using the filetype "AutoCAD 14 Drawing". What are you calling with this string ? NickHK "DDawson" wrote in message ... Nick, I should have included code as info, the project contains a Loopfolders Function which starts with: Function LoopFolders(startPath As String, _ Optional filetype As String = "AutoCAD 14 Drawing", _ Optional subfolders As Boolean = True) ' Create named Ranges, for the appropriate columns in Row 8 of Worksheet etc.. [SNIP] And the Worksheet contains a command button with the line: LoopFolders Range("root").Value, "Microsoft Excel Worksheet" The worksheet is an index which automatically creates hyperlinks to the files and I have used it for PDF files etc. where the filetype rarely varies. But AutoCAD type files are a bugbear. Hope you can help. Regards Dylan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling pdf files from general folder to specific folder | Excel Discussion (Misc queries) | |||
Get a specific Program files folder | Excel Programming | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Programming | |||
DELETING FILES FROM A FOLDER WITH SPECIFIC EXTENSION | Excel Programming |