Jump to content
Sign in to follow this  
erikkn

Excel layout

Recommended Posts

erikkn

Hi all,

I'm using AutoIT for tree weeks now and I made a program that export data to a excel sheet. I am curious if there is a possibility that my data is placed into a table with colors, and many of this tings.

Thank you!

 

Share this post


Link to post
Share on other sites
water

Welcome to Autoit and the forum!

Sure this is possible. Unfortunately the Excel UDF that comes with AutoIt (or my rewrite of the UDF) do not provide many functions to format data.

I suggest:

  • Start the macro recorder in Excel
  • Do all the formatting you need
  • Post the created VBA macro and I will help to translate it to AutoIt

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
erikkn

Great thank you so mutch! I will do it and post it next week

Share this post


Link to post
Share on other sites
erikkn

Hi water,

I don't know what to do, I will explain my dream to you, maybe you can help me:

My plan is to make a checklist program with a GUI. A guy called SDK made a script and I used and changed it a little bit. (I added this script here)

So if you start the program you will see a Graphic Interface. On the menu tab I can add a new checklist and answer some question. When I am finished I go back to Menu and save/export this to an excel file.

Okay here we go, the checklist have to be saved with a nice layout, not plain text. I added a file: layout.xlsx ,and my wish is that the exported checklist has the layout of that file. I also made a macro where you asked for. So, everytime you make a checklist and export this, there must be automatic made a new excel file with the data of the checklist  and in the layout of 'layout.xlsx'.

I'm sorry for my bad English :P, but do you understand me?

Can you help me with this, I am working on this for four weeks now, and it's really drives me crazzy :P

Thank you water,

Ciao ;-)

test.au3

macro.txt

layout.xlsx

Edited by erikkn

Share this post


Link to post
Share on other sites
water

I would open layout.xlsx as a template, insert the data from your GUI in colums B and C and then save the workbook with a different name.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
erikkn

Can you give me a hint (script) how I can do that automatic?

Share this post


Link to post
Share on other sites
water

Download my rewrite of the Excel UDF.

Thi is an untested example:

$oExcel = _Excel_Open()
$oWorkbook = _Excel_BookOpen($oExcel, "C:\temp\layout.xlsx")
_Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, $aTable1, "B3") ; Write first part
_Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, $aTable2, "B10") ; Write second part
_ExcelBookSaveAs(...)
_Excel_BookClose($oWorkbook)
_Excel_Close($oExcel)
  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
erikkn

Thank you water, I will test this. May I ask for your help if i got a prob?

Share this post


Link to post
Share on other sites
water

Sure :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×