Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Apps and Programs
Excel VBA to suppress msgBox prompt?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="flyboy54" data-source="post: 1782677" data-attributes="member: 397782"><p>I have VBA code written on a Windows OS (yes I know) and some of my clients are running on a MAC. The code opens a number of different connections into a FileMaker database using an ODBC connection.</p><p>On each connection, the Mac OS prompts the user to connect. The login and password are already populated as part of the connection string.</p><p></p><p>I would like to know if there is a way to avoid these prompts or intercept them and have the VBA hit enter.</p><p></p><p>I have tried Application.DisplayAlerts = False but it does not work.</p><p></p><p>Below is the code I use to create the connection. DSN_String is the name of the DSN definition in the ODBC Manager.</p><p></p><p>[CODE]</p><p> connstring = "ODBC;DSN=" & DSN_String & ";UID=Admin;PWD=;UID=Admin;PWD=;"</p><p> </p><p> sqlstring = Array( _</p><p> "SELECT Current_Year.Workshop_Year" & Chr(13) & "" & Chr(10) & "FROM Current_Year Current_Year" _</p><p> )</p><p> </p><p> With ActiveSheet.QueryTables.Add(Connection:=connstring, _</p><p> Destination:=Range("I10"), Sql:=sqlstring)</p><p> .refresh</p><p> End With</p><p>[/CODE]</p><p></p><p>Thanks</p></blockquote><p></p>
[QUOTE="flyboy54, post: 1782677, member: 397782"] I have VBA code written on a Windows OS (yes I know) and some of my clients are running on a MAC. The code opens a number of different connections into a FileMaker database using an ODBC connection. On each connection, the Mac OS prompts the user to connect. The login and password are already populated as part of the connection string. I would like to know if there is a way to avoid these prompts or intercept them and have the VBA hit enter. I have tried Application.DisplayAlerts = False but it does not work. Below is the code I use to create the connection. DSN_String is the name of the DSN definition in the ODBC Manager. [CODE] connstring = "ODBC;DSN=" & DSN_String & ";UID=Admin;PWD=;UID=Admin;PWD=;" sqlstring = Array( _ "SELECT Current_Year.Workshop_Year" & Chr(13) & "" & Chr(10) & "FROM Current_Year Current_Year" _ ) With ActiveSheet.QueryTables.Add(Connection:=connstring, _ Destination:=Range("I10"), Sql:=sqlstring) .refresh End With [/CODE] Thanks [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Apps and Programs
Excel VBA to suppress msgBox prompt?
Top