Doesn't seem to be working without that line. So, I guess I'll stick with trying to turn the reference on and off.
Is their a lag period between turning it on and using it? The program gives an error like it hasn't turned on (mso folder picker gets mad) but when you check the references box the office 12 object library is selected.
Dim refMSO12 As References
Set refMSO12 = New References
'Adds in the Microsoft Office 12.0 Object Library
strGUID = "{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}"
ThisWorkbook.VBProject.References.AddFromGuid(strGUID, 2, 4) = refMSO12
' Get the import directory from the user
With Application.FileDialog(msoFileDialogFolderPicker) ' --> Acts like the reference isn't there
.Show
If .SelectedItems.Count = 0 Then Exit Sub 'user cancelled
strFolder = .SelectedItems(1)
End With
Thanks!
Bookmarks