Sending Excel worksheet to open in SAS through Excel VBA

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

Sending Excel worksheet to open in SAS through Excel VBA

How do I open SAS and send my worksheet from Excel to SAS by clicking a button (created by macro) in Excel using VBA?

 

I have this so far, but not sure if it has started correct or how to proceed.

If anyone has advice or has done it, sharing the VBA code would be most appreciated!

 

Sub New_Program()

    Set SAS = CreateObject("SAS.Application")
    SAS.Visible = True
    SAS.Wait = True


End Sub


Accepted Solutions
Solution
‎07-21-2017 12:39 AM
Super Contributor
Posts: 401

Re: Sending Excel worksheet to open in SAS through Excel VBA

A few years ago I did a Global Forum paper on running SAS from Excel through VBA and ADO.You can find the paper at this link

 

I think pages 8-11 might be more or less the code you need - it turns a spreadsheet range into a SAS data set but you should be able to adapt it to suit your purposes.

View solution in original post


All Replies
Solution
‎07-21-2017 12:39 AM
Super Contributor
Posts: 401

Re: Sending Excel worksheet to open in SAS through Excel VBA

A few years ago I did a Global Forum paper on running SAS from Excel through VBA and ADO.You can find the paper at this link

 

I think pages 8-11 might be more or less the code you need - it turns a spreadsheet range into a SAS data set but you should be able to adapt it to suit your purposes.

Super Contributor
Posts: 315

Re: Sending Excel worksheet to open in SAS through Excel VBA

Seems to be a problem best solved by using SAS Addin for MS Office.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 163 views
  • 1 like
  • 3 in conversation