SOLVED

Open File Dialog Box Issue

Copper Contributor

Hello:

I have used the Open File dialog Box VBA for years.  When I tried it on a workbook that is linked to Google Sheets (a connection), it dims the open button when I select the workbook.  Any ideas why it is dimmed?

 

Here's the code to call it:

 

Call FileDialogueOpen

If strCancel = "Y" Then
MsgBox ("An Open Error Occurred Importing Your File Selection")
Exit Sub
End If

 

Here's the actual code:

Private Sub FileDialogueOpen()
Application.ScreenUpdating = False
Dim dlgOpenFile As FileDialog
Dim strFilePathToQualityException As String

strFilePathToQualityException = ""
Set dlgOpenFile = Application.FileDialog(msoFileDialogOpen)
With dlgOpenFile
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Excel 2007-2016 Workbook", "*.xlsx"
.FilterIndex = 1
.Title = "Select Quality Exception Excel Report"
.Show
If .SelectedItems.Count < 1 Then
strCancel = "Y"
Exit Sub
End If
strFilePathToQualityException = .SelectedItems(1)
End With

Workbooks.Open strFilePathToQualityException
strFileNameOpenedByUser = ActiveWorkbook.Name

End Sub

 

It is a solid piece of code, but it doesn't work when I try to open a Google Connected workbook because the Open button is dimmed.

 

Any advice would be helpful.

 

Thanks,

Rich Locus

 

2 Replies
best response confirmed by Rich_Locus (Copper Contributor)
Solution

@Rich_Locus 

This is hard to test if you don't have a workbook with a link to Google Sheets...

Thanks Hans.
Rich
1 best response

Accepted Solutions
best response confirmed by Rich_Locus (Copper Contributor)
Solution

@Rich_Locus 

This is hard to test if you don't have a workbook with a link to Google Sheets...

View solution in original post