Hello,
I am getting a carriage return that is preventing the last line of code here from firing
Sub BuildPPT()
Dim FilePath As String
Dim TextFile As Integer
Dim FileContent As String
Dim URL1 As String
Dim URL2 As String
Dim varrPos As Variant
Dim i As Long
Dim pptStrFile As String
'File Path & Name of Text File
FilePath = GetDownloadPath & "Category Review BUCategory.txt"
'Determine the next file number available for use by the FileOpen function
TextFile = FreeFile
'Open the text file
Open FilePath For Input As TextFile
'Store file content inside a variable
FileContent = Input(LOF(TextFile), TextFile)
'Close Text File
Close TextFile
pptStrFile = Trim(GetDownloadPath) & Trim(FileContent)
pptStrFile = Trim(Replace(pptStrFile, vbCr, ""))
ActivePresentation.Slides.InsertFromFile pptStrFile, 1, 1, 26
The value of pptStrFile should be:
C:\Users\mogr0002\Downloads\Category Review Grand Canyon - Packaged Beverages.pptx
The immediate window for ? pptStrFile returns the value I am looking for but then adds another blank line below it which I don't why and that is preventing the last line of the code from working.
The text that is in the text file that is being read is:
Category Review Grand Canyon - Packaged Beverages.pptx
Any thoughts?