Couchbase and Excel MACRO support


I have a requirement of querying documents from a excel macro .I did saw some of the links where the data is getting displayed in Excel

Could you please share any link or a guide for me to start the MACRO development . I am looking more at authetication and data retrival .
.NET SDK #macro n1ql connections dot-net #

Please help


Have you tried any of the getting started guides with .NET? Assuming Excel macros are written with .NET these days, any of the Couchbase .NET documentation will apply: Start Using the .NET SDK | Couchbase Docs

I don’t think there is anything macro-specific in documentation or tutorials. Generally speaking, Excel or Power BI would be used for these types of use cases, and would connect via ODBC/JDBC, and not require any macro development.

You may wish to investigate calling the REST API from Excel.

Thanks . I started on those lines . It is getting connected but getting these messages . ‘Server did not agree on protocol’ . I do have the object there and could query from UI . It is not local host and a CB instance deployed in cloud

Please let me know your thoughts.


I recommend you cut-and-paste the examples and change the parts specific to your environment to avoid errors. The secure query service is on port 18093 (not 18091).

Notice that in the curl output that your GET only goes as far as the first space in your select statement? So you have an issue with how DOS interprets your curl command. ( you can probably avoid this by specifying a URL-encoded url, maybe. all you need is to replace the spaces with %20). Or put quotes around the whole url. Probably something you can google.

Using --insecure to avoid needing the --cacert (but you should use the cacert).

curl -v --insecure 'https://localhost:18093/query/service?statement=SELECT%201' -u Administrator:password
* Trying
* Connected to localhost ( port 18093 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Client hello (1):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Server hello (2):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Unknown (8):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Certificate (11):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, CERT verify (15):
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Finished (20):
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES128-GCM-SHA256
* ALPN: server accepted h2
* Server certificate:
* subject: CN=Couchbase Server Node (
* start date: Aug 27 21:05:25 2023 GMT
* expire date: Nov 29 22:05:25 2025 GMT
* issuer: CN=Couchbase Server a2e64ecd
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Server auth using Basic with user 'Administrator'
* h2h3 [:method: GET]
* h2h3 [:path: /query/service?statement=SELECT%201]
* h2h3 [:scheme: https]
* h2h3 [:authority: localhost:18093]
* h2h3 [authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==]
* h2h3 [user-agent: curl/7.87.0]
* h2h3 [accept: */*]
* Using Stream ID: 1 (easy handle 0x7fb85580bc00)
> GET /query/service?statement=SELECT%201 HTTP/2
> Host: localhost:18093
> authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==
> user-agent: curl/7.87.0
> accept: */*
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 200
< content-type: application/json; version=8.0.0-N1QL
< content-length: 254
< date: Fri, 03 Nov 2023 17:48:37 GMT
"requestID": "06545957-3f91-41c0-841d-5f890a0889eb",
"signature": {"$1":"number"},
"results": [
"status": "success",
"metrics": {"elapsedTime": "649.804µs","executionTime": "611.091µs","resultCount": 1,"resultSize": 8,"serviceLoad": 2}
* Connection #0 to host localhost left intact

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.