Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8825085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:47:40+00:00 2026-06-14T06:47:40+00:00

I have no idea about excel macro. I need to get the data from

  • 0

I have no idea about excel macro. I need to get the data from MySQL and display it in excel. Can i get any links or code examples for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:47:41+00:00Added an answer on June 14, 2026 at 6:47 am
    Sub ADOExcelSQLServer() 
      Dim Cn As ADODB.Connection 
      Dim Server_Name As String 
      Dim Database_Name As String 
      Dim User_ID As String 
      Dim Password As String 
      Dim SQLStr As String 
      Dim rs As ADODB.Recordset 
      Set rs = New ADODB.Recordset 
    
    Server_Name = "" ' Enter your server name here
    Database_Name = "" ' Enter your database name here
    User_ID = "" ' enter your user ID here
    Password = "" ' Enter your password here
    SQLStr = "select Period, Secured, Unsecured from cmisa.credit_facts" 
    
    Set Cn = New ADODB.Connection 
    Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & _ 
    ";Uid=" & User_ID & ";Pwd=" & Password & ";" 
    
    rs.Open SQLStr, Cn, adOpenStatic 
     ' Dump to spreadsheet
    With Worksheets("1.Overview").Range("AI7:AK19") ' Enter your sheet name and range here
        .ClearContents 
        .CopyFromRecordset rs 
    End With 
     ' Tidy up
    rs.Close 
    Set rs = Nothing 
    Cn.Close 
    Set Cn = Nothing 
    

    End Sub

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Can Any one have idea about below code and its related error. code:
I missed my workspace in which I was working. Any one have idea about
Anyone have any idea about CASlotProxy Class in Cocoa (iOS SDK)? I found it
Please let me know if you have any idea about it. Thanks EDIT What
I have a very little idea about what database file system is. Can somebody
Anyone have any idea how I would go about converting a timestamp in milliseconds
I have created a console application which transfers data from an excel sheet and
Remove last digit from B_NBR. These all numbers are different. anybody have idea about
I have to port an algorithm from an Excel sheet to python code but
I need to write an excel-like grid that can have a lot of cells

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.