PlanMaker Background Colours

Post your questions, bug reports and suggestions here for BasicMaker 2016 for Windows.

Moderator: SoftMaker Team

Post Reply
Shando69
Posts: 1
Joined: Sun Jan 14, 2018 12:35 am

PlanMaker Background Colours

Post by Shando69 » Sun Jan 14, 2018 12:43 am

Hi All,

This should be an easy request, but I can't seem to find out how to do it :(

I am writing code to colour the background of a cell based on the RGB values held in other cells. So, for example, I have a list of Hex & RGB values for the colours I want to use (this is just a subset):

000000 0 0 0
121212 18 18 18
151515 21 21 21
161616 22 22 22
1b1b19 27 27 25
1e1e1e 30 30 30

Now, in my BasicMaker code, I would like to be able to use the above table to set the background colour of a particular cell based on certain logic (assume for the moment that it's simply going down the list and colouring a cell in the same row).

This is the code I have so far (ignore any superfluous vars as I always dim more than I need when I start a new program) which doesn't work:

Code: Select all

Option Explicit

sub mysub()
dim pm as Object
dim oSheets, oSheet, oCellByPosition
dim x, y, z, z1, a, b, c, d as integer
dim aa, bb, cc, dd, ee, ff, gg, hh, tmp, dt, ctor, pub as string

Set pm = CreateObject("PlanMaker.Application")
pm.Application.Visible = True
pm.Activate

y = 0
b = 0
d = 2

for x = 1 to 44
	aa = "b" & x
	bb = "c" & x
	cc = "d" & x
	dd = "f" & x
	ee = "h" & x

	a = 0
	b = 0
	c = 0
	
	a = pm.Application.ActiveSheet.Range(aa).value
	b = pm.Application.ActiveSheet.Range(bb).value
	c = pm.Application.ActiveSheet.Range(cc).value
	d = pm.Application.ActiveSheet.Range(ee).value2

	pm.Application.ActiveSheet.Range(dd).Shading.BackgroundPatternColor = d
next x
end sub
In the manual it keeps stating:

"BGR" value (Blue-Green-Red triplet). You can either indicate an arbitrary value or use one of the pre-defined BGR color constants.

but never actually seems to explain how to "indicate an arbitrary value"!

Any help would be greatly appreciated.

Thanks in advance

Shando

sven-l
SoftMaker Team
SoftMaker Team
Posts: 7646
Joined: Wed Apr 09, 2008 8:26 am
Location: Nuremberg
Contact:

Re: PlanMaker Background Colours

Post by sven-l » Fri Jan 19, 2018 2:27 pm

I will ask the developers and inform you as soon as I have more information.
Sven Leßmann
SoftMaker Software GmbH

sven-l
SoftMaker Team
SoftMaker Team
Posts: 7646
Joined: Wed Apr 09, 2008 8:26 am
Location: Nuremberg
Contact:

Re: PlanMaker Background Colours

Post by sven-l » Fri Jan 19, 2018 3:06 pm

According to our developers:
pm.Application.ActiveSheet.Range(dd).Shading.ForegroundPatternColor = 100.0+101*256+256.0*256*102

Creates a user defined color and sets the shading of the cell to R=100, G=101 and B=102

To avoid creating too many user defined colors you maay use ForegroundPatternColorIndex + BackgroundPatternColorIndex + Intensity to mix a shading from the existing colors.
Sven Leßmann
SoftMaker Software GmbH

Post Reply

Return to “BasicMaker 2016 for Windows”