The SAS Output Delivery System and reporting techniques

Writing vb script into an Excel file

New Contributor
Posts: 3

Writing vb script into an Excel file


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()


End Sub

Posts: 8,820

Re: Writing vb script into an Excel file


  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.


Occasional Contributor
Posts: 6

Re: Writing vb script into an Excel file

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

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation