BookmarkSubscribeRSS Feed
Dawn_Wu
Obsidian | Level 7

Dear All,

 

I use SAS DDE to generate hundred of excel reports for different cities.

Currently, company rule applied, that each excel file should be labeled before saving.

Originally, it is a totally auto process. 

Currently, I have to click on Label-"Internal" for each file.

suffering. 

Can anyone guide me how to solve this? say add code in DDE to auto select excel label as "internal".

 

Thanks a lot.

Regards,

Dawn

 

 

Excel file label.png

6 REPLIES 6
Tom
Super User Tom
Super User

Why are you asking on a SAS forum for the Microsoft Excel command to change some Microsoft Excel document setting?

Not sure if Microsoft is even documenting DDE anymore.  They might not have even created any commands that you could submit via DDE that would impact options added after DDE as shelved.

ballardw
Super User

I don't know what an Excel "Label" might be. I do know that any process relying on DDE is just waiting to quit working for any number of reasons. The communications channels that DDE uses can be used by other programs rendering DDE unusable, Cisco Jabber is the one I ran into that broke the only SAS program that I have that used DDE.

 

Since Excel files can be created with ODS EXCEL you likely should be considering that as a tool to create the files.

 

The image you show relates to Microsoft Azure. I would look to the documentation there to see if there are either settings or scripts that will do what you want. If Azure will run some sort script to set those it is quite likely that you could create a script file from SAS.

Reeza
Super User

This may be part of a sensitivity label. 

So DDE was developed for Excel 4.0 and this feature is newer, like 2017+ so the DDE doesn't have an automatic way of doing this. But DDE can run macros. I would look into macro/VBA commands to set the sensitivity and then use that approach. 

 

Or load files to one location and then bulk upload to the Azure file storage setting the sensitivity label via a script instead. 

Dawn_Wu
Obsidian | Level 7

Hi Reeza,

Yes, it is a sensitivity tag just required by the company.

 

You mentioned "I would look into macro  to set the sensitivity "

 

that's what I try to do. but i don't know how to add code in SAS DDE macro to tag the file to "Internel" before last step-saving file.

 

Can you share the code? Thanks.

 

Regards,

Dawn 

Kurt_Bremser
Super User

First, create a Powershell/VBA script which does it, then run this script from SAS as an external command.

DDE is deprecated, so do not use it anymore.

Patrick
Opal | Level 21

And if looking into a more automated way that also doesn't use DDE anymore also consider below information from Microsoft:

Patrick_0-1660814810152.png

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 6 replies
  • 1981 views
  • 0 likes
  • 6 in conversation