web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Using a plugin to connect to a pre-existing excel file and "past as values only"?

(0) ShareShare
ReportReport
Posted on by 1,589

Is the following possible in Dynamics CRM 2011 via plugin?

I'd like to put a custom button on a ribbon that runs a plugin that runs when the button is pressed.

The plugin will need to do the following:

Receives data from a C# function/procedure containing values that have been generated via Query Expression

Then connects to a specially formatted excel spreadsheet that will be sitting out on disk, and performs the equivalent of "Pasting Values Only" column by column into that pre-existing excel spreadsheet.

The use case and requirements are very detailed so the only way to meet them is to connect to the sheet, find the first column based on the column name in the first row or a specific row I will know ahead of time, and then  "past as values" into that column,  the data obtained via query expression.

Then the process will repeat until all relevant columns are filled.

Nobody will open the spreadsheet while the process is happening, the only thing touching it will be Dynamics CRM.

If something like this is possible, can anyone provide some high level guidance as to the particulars I need to look into in order to achieve it?

Many thanks in advance for any guidance, recommendations, or assistance regarding how to approach this.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    If you are using CRM On-Prem, and have your Plugin in Non-Isolated mode, you can access the Excel file (if you have access to it via network).

    There are various vendors that have Excel Libraries that allow you to manipulate and query data in Excel.

    We have used Infragistics, but you can do this directly via Office SDK. You might have to install Office 2007 PIA on the server.

    You will need to make sure that any assemblies that you need to access (outside of the plugin) are either registered in the GAC or in the file system under Program Files\Microsoft Dynamics CRM\Server\bin\assembly directory.

    The rest is up to you on how to manipulate the Excel file.

    I would test this running a console app and make sure that I get the results I want, and only then deploy the logic to plugin. Much easier to debug as Console Application.

    Hope this helps. Good luck.

  • ACECORP Profile Picture
    1,589 on at

    Yes it does. Big help. Thanks so much!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans