IMO, Marty, you're way over complicating! The following checks the list
for valid paths and if not found then prompts to locate the correct
path. This should result in a list of valid paths so long as the
correct path is found.
If the correct path IS found then the list is updated with the new
value. Otherwise, the routine ends after notifying the user to update
the list and try again...
Option Explicit
Sub CreatePPT()
Dim vList, n&, oPres, vPath
Dim rngSource As Range
'Edit to suit...
Const sTitle$ = "Select the correct location for this file"
Const sMsgFail$ = "Valid paths are required!" _
& vbLf & vbLf _
& "Please revise the list and try again."
Set rngSource = Selection '//edit to suit
vList = rngSource
'Ensure valid paths
For n = LBound(vList) To UBound(vList)
If Not bFileExists(vList(n, 1)) Then
'Prompt for the correct path
vPath = Application.GetSaveAsFilename(vList(n, 1), , , sTitle)
'If found, update the list
If Not vPath = False Then
vList(n, 1) = vPath: rngSource = vList
Else
MsgBox sMsgFail: Exit Sub
End If 'Not vPath = False
End If 'Not bFileExists
Next 'n
On Error GoTo Cleanup
'If we got here then we have a valid paths,
'so automate a new instance of PowerPoint
With CreateObject("PowerPoint.Application") 'appPPT
'Add a new presentation
Set oPres = .Presentations.Add
With oPres.slides
'Insert the slides into the presentation
For n = LBound(vList) To UBound(vList)
.InsertFromFile vList(n, 1), .Count
Next 'n
End With 'oPres.slides
.Visible = True
End With 'CreateObject
Cleanup:
Set oPres = Nothing: Set rngSource = Nothing
End Sub
Function bFileExists(Filename) As Boolean
' Checks if a file exists in the specified path
' Arguments: Filename (Variant) The fullname of the file
' Returns: TRUE if the file exists
On Error Resume Next
bFileExists = (Dir$(Filename) <> "")
' bFileExists = (FileLen(Filename) <> 0) '//optional method
End Function
To run your FourSQ_Dead_Hyperlinks routine on any sheet just activate
the sheet and select the range to 'flag'...
Sub FourSQ_Dead_Hyperlinks()
' Find Dead Hyperlinks
Dim c As Range
For Each c In Selection
If len(c.Value) and Not bFileExists(c.Value) Then _
c.Interior.Color = 65535
Next
MsgBox "Check Complete"
End Sub
...whch gives you the option to choose non-contiguous cells.
I can't assist you with the slide format issue. (As far as I see.., the
presentation inserts the sample slides "as is" in terms of how they
open in PPT individually!)
--
Garry
Free usenet access at
http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion