Thanks p45cal! I ended up removing the line containing " Set wdDoc = Nothing: Set wdapp = Nothing: Set WkSht = Nothing".
It also seems to work with "wdApp.Quit" removed completely.
Can you speak to the efficiency of the code? I'm no programmer, and it probably shows.
For continuity's sake, I will repost my updated code below.
'This code pulls word documents with Content Controls and inserts them into a spreadsheet for analysisSub getformdata()
'Prevents screen from refreshing during Macro to make it more efficient (???)
Application.ScreenUpdating = False
'
'Set up variables
Dim wdapp As New Word.Application
Dim wdDoc As Word.Document
Dim CCtrl As Word.ContentControl
Dim strFolder As String
Dim strFile As String
Dim WkSht As Worksheet
Dim i As Long
Dim j As Long
'Defines "strfolder" as the appropriate folder from which you want to pull your word documents from
'It does so using the "GetFolder()" separate function below
strFolder = GetFolder
'If there is nothing in the specified folder, this line tells the macro to stop
If strFolder = "" Then Exit Sub
'
'
'Set data to dump on sheet number one regardless of what sheet in the work book you are on
Set WkSht = Worksheets(1)
'Sets "strFile" as the name of the first word doc in the chosen folder path
strFile = Dir(strFolder & "\*.doc", vbNormal)
'The below while loop grabs a word doc in the specified folder, pastes all the Content Controlled fields of a word doc in a specified row/column based on the column header in row 1
While strFile <> ""
Set wdDoc = wdapp.Documents.Open(Filename:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False, ReadOnly:=True)
With wdDoc
For Each CCtrl In .ContentControls
With CCtrl
Select Case .Type
Case wdContentControlDate, wdContentControlDropdownList, wdContentControlRichText, wdContentControlText
j = Application.WorksheetFunction.Match(CCtrl.Title, Range("1:1"), 0)
i = WkSht.Cells(WkSht.Rows.Count, j).End(xlUp).Row
i = i + 1
WkSht.Cells(i, j).Value = .Range.Text
Case Else
End Select
End With
Next
wdDoc.Close SaveChanges:=False
strFile = Dir()
Application.ScreenUpdating = True
End With
Wend
End Sub
' The following function is called for use in the above Sub getformdata()
'
'The function opens up a box to select the folder for which all the word docs in question should be located
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