PDA

View Full Version : Pass Macro results to Javascript in Mac



MacroUser
08-19-2014, 10:40 AM
Hello All,

I've a macro that pulls information from the SQL server database on MAC. I want to pass the output of the macro to Javascript message box. Is there a way I could write javascript inside the macro? Can anyone help me out with this?
Thanks,

Here is my macro

Sub GetBookSpec()

Dim sqlstring As String

Dim connstring As String

Dim Strcode As String

Strcode = Trim(InputBox("Please enter the custcode", "Customer"))

sqlstring = "SELECT ID, customername, customeraddress WHERE b_Identity = '" & Trim(Strcode) & "'"

connstring = "ODBC;DSN=DSNMAC;UID=MacUser;PWD=test123"

Dim thisQT As QueryTable

Set thisQT = ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=Range("a1"))

thisQT.BackgroundQuery = False

thisQT.Sql = sqlstring


thisQT.Refresh

End Sub