Sign in to follow this  
Followers 0
marcsusy

How to create edges in an Excel Chart

5 posts in this topic

Hello:

I have a question, how I can create borders in an Excel table.

thanks

Share this post


Link to post
Share on other sites



Hi, marcsusy. How about an example script to show us what you're working on, rather than having us guess? :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

We can use the following example of Autoit:

$MyExcel = ObjCreate("Excel.Application")

if @error then

Msgbox (0,"","Error creating Excel object. Error code: " & @error)

exit

endif

if not IsObj($MyExcel) then

Msgbox (0,"ExcelTest","I'm sorry, but creation of an Excel object failed.")

exit

endif

$MyExcel.Visible = 1

$MyExcel.workbooks.add

dim $arr[16][16]

for $i = 0 to 15

for $j = 0 to 15

$arr[$i][$j] = Chr($i+65)&($j+1)

next

next

$MyExcel.activesheet.range("A1:O16").value = $arr

Sleep(2000)

$MyExcel.activeworkbook.saved = 1

$MyExcel = 0

Share this post


Link to post
Share on other sites

What do you really want to do? Create borders around an array of Excel cells (you named it "table") or create edges in an Excel Chart (as you have written in the thread subject)?

A screenshot or example code would be fine.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

#5 ·  Posted (edited)

Use the developer tool to record macros to figure stuff out:

Range("A1:L19").Select

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.ColorIndex = 0

.TintAndShade = 0

.Weight = xlMedium

End With

Selection.Borders(xlInsideVertical).LineStyle = xlNone

Selection.Borders(xlInsideHorizontal).LineStyle = xlNone

you will need to google the variable values...or create a message box, and include the variables to figure out the integers

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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  
Followers 0