Share via

CSV files & templates

Anonymous
2012-11-30T21:50:25+00:00

I have what should be a simple problem, but I'm stuck.

I have an app that generates a CSV file every day. I'd like my customers to be able to double-click on that CSV and have it open in Excel, with a particular template. That is to say, I'd like to give my customers an Excel template with the correct formating, and even a few other nifty things (e.g. some charts, some formulas, etc.)

My first idea is that this could be done either after the file is open (by clicking a "Format As XYZ Report" button"), but I can't see any way of telling Excel to take the current worksheet and apply a template.

The other idea I had was to do this at open time, by supplying a template on the command line of a shortcut. Dragging and dropping the CSV on the shortcut should then apply the template. I tried creating a shortcut with the target "c:\program files\office\excel.exe /t c:\templates\mytemplate.xltx", but that did not work either.

I'm a bit stumped...

Any ideas?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2012-12-06T17:04:21+00:00

    Create an AddIn, use the Workbook_Open event and look if the current opened file is a CSV file. If so, release the CSV and load it into your template.

    Andreas.

    Was this answer helpful?

    0 comments No comments