View Single Post
 
Old 08-09-2017, 09:47 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,367
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your 'Main' code module has a sub named 'PopulateDynamicDDList(oCombo As ComboBox)' in which you'll find a line with:
ThisDocument.Path & Application.PathSeparator & "S8Addresses.xlsx"
you could change:
ThisDocument.Path
to any other path, or even allow the user to select a path by using:
GetFolder
combined with the following function:
Code:
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
Note: You might want to add some error checking if you use the function; otherwise your code is liable to crash if a valid path isn't selected.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote