結論から先に書くと、%LOCALAPPDATA%\Google\Chrome\User Data以下にあるプロフィールディレクトリを指定してプロフィールを使用することはできません。
%LOCALAPPDATA%\Google\Chrome\User Data 以外にプロフィールデータを置くことで、Googleログインが可能です。
SeleniumBasicでGoogleログインする方法
SeleniumBasicから立ち上げたブラウザからはGoogleログイン時に弾かれます。
Google ログインできませんでした このブラウザまたはアプリは安全でない可能性があります 詳細 別のブラウザをお試しください。サポートされているブラウザをすでに使用している場合は、もう一度ログインをお試しください。

おそらくデバッグモードか何かをチェックしているのでしょうが、以下方法で回避します。
Chromeの起動オプションを使って正規の方法で別フォルダにGoogleログイン済みのプロフィールを作成する
コマンドプロンプトから、以下のコマンドで立ち上げたブラウザでログインをします。
ディレクトリは各自適当に読み替えてください。
C:\Program Files\Google\Chrome\Application\chrome.exe" --user-data-dir="D:\SeleiumBasic\Chrome\hogehoge"
SeleniumBasicからの利用
SeleniumBasicからは以下のコードでGoogleログイン済みのChromeが立ち上がってきます。
Sub main()
Dim driver As New ChromeDriver
With driver
.AddArgument "--user-data-dir=D:\SeleiumBasic\Chrome\hogehoge"
.Get "https://mail.google.com/"
End With
End Sub

以下は古い情報
SetProfile は罠
%LOCALAPPDATA%\Google\Chrome\User Data に以下のフォルダがあったとする。

Profle 3に切り替えるには以下のコードで切り替えできる。
Dim driver As New ChromeDriver
With driver
.AddArgument "--user-data-dir=" & Environ$("LOCALAPPDATA") & "\Google\Chrome\User Data"
.AddArgument "--profile-directory=Profile 3"
.Get "https://www.yahoo.co.jp/"
End With
64bit版Chrome 87.0.4280.88で動作確認

chromedriver.exe

コメント