0

I am a system programmer and what i want to do is to send daily a csv file to a group of administrators by mail. They click on the attachment and it opens in Excel with a corresponding chart.

This means that all the code to generate the excel chart is embedded in the file. As this is a corporate usage, i suppose that i can only use strict Excel available tools.

Do you think that it is possible to do this ?

( I can't generate the graph first and send it because on the machine where the data comes from there is a very strict security restriction and we can't install extra software)

dt n
  • 1

1 Answers1

0

as far as I know it is not possible to save & run a macro in a csv file. Therefore my suggestion will be;

Record or write a macro (named csvChartMacro lets say) in an excel file which will create your chart.

Then save this file as an .xlam addin file and put it somewhere in your network.

Inform your users to open this .xlam file after opening the csv file and while csv is the active window tell them to hit Alt + F8 and run macro csvChartMacro to create their graphs.

p.s. if this type of needs grow in future, you can add related macro operations in the same xlam file and maybe you can create a ribbon tab and assign your macros to buttons in that ribbon tab.

Ozgun Senyuva
  • 466
  • 5
  • 12
  • this would work, `.xlam` could be very useful. they could also install the addin, so it is always available when they open excel. another thought would be to take them to a web page that displays the chart. you could use google charts or something... – WhiteHat Nov 04 '21 at 12:11
  • @WhiteHat a web page would be stylish but one question for myself not regarding this question: Is there a way to create a small web portal for these type of needs without IIS or a real server. Since I am not an IT guy, I do not have priviliges like running IIS in my workstation. – Ozgun Senyuva Nov 04 '21 at 12:34
  • I'm in a similar situation, but we have SharePoint, where I can generate web pages. In the past I've installed IIS or Tomcat on a PC somewhere on the network that is always on, but that is not a good long-term solution. only other thought is there may be a free site somewhere on the internet...? but I do work for a company that has no web server, I've used the `.xlam` approach and it works very well. All of the analysts have it installed, I do have a ribbon as suggested by @Ozgun, with several menu options to assist the analysts in their jobs. – WhiteHat Nov 04 '21 at 12:46
  • for the `.xlam` ribbon menu, search Excel customUI.xml – WhiteHat Nov 04 '21 at 12:49
  • just thinking out loud here, but you could generate a web page using an hta application that runs on windows. but it would be a lot of work. – WhiteHat Nov 04 '21 at 12:51
  • I finally found a solution , i generate an html page with code using google chart from a rexx program, then i just send this html file, people just click on it to visualize the chart - it is really simple. – dt n Sep 16 '22 at 23:11