ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
Airgonomike
Calcite | Level 5

Hi,

Is it possible to use ExcelXp to write some vb macros into the Excel file at the time it is created?

Example, would I be able to create an Excel file with this Macro pre-written in it?

Sub Macro()

    Sheets(1).Select

End Sub

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  This is a question for Tech Support. I know that with some of the tagset templates, especially the ones designed for Excel, it is possible to use an Excel macro. I am not so sure about VB. The tagsets.tableeditor template, for example uses embedded JavaScript code to take an HTML file and write it to Excel. But, I don't know how "modifiable" the JavaScript is or whether you can substitute VB instead. Really a question for the tagset templates and VB experts in Tech Support.

cynthia

mattyclown
Fluorite | Level 6

I did not use ExcelXpm to create Excel file so I do not know whether following code is what you are looking for. Hope it can offer you some useful information to help you finish your Excel reading application.

You can find the code at this page:

VBScript to Write a Macro within an Excel file - Stack Overflow

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1494 views
  • 0 likes
  • 3 in conversation