Automatically update of page content from Excel VBA
Asked by Muhammed Cihad Akkaya:

Hello, I have multiple excel files regarding my projects in my computer and I have also pages for every project in my company's confluence space. So when the excel is updated, I wanna update automatically the respective page on confluence. For a very new to confluence guy, I come across with REST API, but I couldn't be sure that if it works for this task. Another solution I think of is finding a way of updating the source codes of the pages automatically from VBA, but how? Even both are possible can you please guide me which one I choose and what is the route map for succeeding in this?

BTW, when I have a look at the example REST API codes for content update, they are looking very different than the page source code, In the source code, which part of the code is indicating which part of the content is obvious but for the REST API it's quite complicated, if you can explain the difference as well, it'd be appreciated.

Thanks

Muhammed


Answers:
author: Katerina Kovriga {Stiltsoft}
body: Hi [@Muhammed Cihad Akkaya](/t5/user/viewprofilepage/user-id/4577661) ,

We can suggest browsing the Marketplace - it seems that there should be even free apps that allow you to create good-looking tables from CSV files/URLs/Google Docs. So, you'll be able to update your local table and all the changes will be reflected on the Confluence page.

As for our own app (that is [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=server&tab=overview)), it is a paid app which main purpose is to replace Excel and [filter](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Filter+macro), [aggregate](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Pivot+Table+macro), calculate and [visualize](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Chart+from+Table+macro) table data right in Confluence. But it also provides the [Table from CSV](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+from+CSV+macro) macro that may accomplish your case.


author: sanjeev kumar
body: [@Muhammed Cihad Akkaya](/t5/user/viewprofilepage/user-id/4577661) Hi, Did you get the approach to solve this problem? Please help


author: Kishan Sharma
body: Hi [@Muhammed Cihad Akkaya](/t5/user/viewprofilepage/user-id/4577661) Welcome to Atlassian Community!

Can't you directly attach the Excel to your confluence page and modify it through confluence itself ? If that works for you, it is pretty straight forward.

comments: author: Muhammed Cihad Akkaya
body: Hello [@Kishan Sharma](/t5/user/viewprofilepage/user-id/554991),

Thank you very much for the fast reply first, but this doesn't work for me because I want to use a specific page template on Confluence, and in every update of excel, I have other different tasks to be done additionally confluence page update.


author: Kishan Sharma
body: Thanks for confirming [@Muhammed Cihad Akkaya](/t5/user/viewprofilepage/user-id/4577661) In that case, please refer comment on [this thread](https://community.atlassian.com/t5/Confluence-questions/How-can-i-create-a-new-page-from-a-users-template-using-rest-api/qaq-p/1059884) to know how you can create a page on confluence using a specific template and write data to it.


author: Muhammed Cihad Akkaya
body: Thank you [@Kishan Sharma](/t5/user/viewprofilepage/user-id/554991), but this doesn't really address my question. I have already pages in a distinct template, my question is more related to automatically updating multiple pages from vba.


author: Kishan Sharma
body: Just some thoughts on what you can do, assuming you have a table in an excel file, you will need to code your VBA script to -

1. Read your excel file having the table
2. Post a REST API call to update the confluence page having the same table as your excel file

You can find an example script [here](https://gist.github.com/andymotta/7ce6b90e9daa3c76f206138b43b530c1), which is written in python.

Refer Confluence REST API Documentation [on this link](https://docs.atlassian.com/ConfluenceServer/rest/7.11.6/). If you need help with REST APIs from fellow developers, I would suggest posting it on [Atlassian Developer Community](https://community.developer.atlassian.com/) for better answers.


Tags: confluence-server

ms-excel

server

update

visual-basic