BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jos283
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisBrooks
Ammonite | Level 13

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

2 REPLIES 2
ChrisBrooks
Ammonite | Level 13

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.

andreas_lds
Jade | Level 19

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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