Jump to content

Some clarifications & help needed


Recommended Posts

Dear all,

I have 2 clalrifications:

1. I am now using _Excel_PictureAdd function to add pictures but the

expected ratio is not achieved.I want my png file to fit from B18 to H30

but now its not as I expect and becomes smaller. is there anything I

need to do?

The script is as follow:

     $Count2=18

     $bitmap= FileReadLine ("C:Testimage"& "filename.txt", $j)
_Excel_PictureAdd($oWorkbook, $oWorkbook.Activesheet, "C:Testimage"&""& $bitmap, "B"&$Count2&":"&"H"&$Count2+11)

2. I want to copy many bitmaps...but when any bitmap is not available I want
to write a comment "NG" in red font and go to next.
Now with the present code it stops in between.

Can anyone help me.

Link to comment
Share on other sites

  1. If you want to fit the picture exactly in the specified range you need to set parameter $bScale = False. "False will fill the $vRangeOrLeft regardless of original aspect ratio"
  2. You need to provide more information (the code you use)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

1. Do you mean it should be like this.
_Excel_PictureAdd($oWorkbook, $oWorkbook.Activesheet, "C:Testimage"&""& $bitmap, "B"&$Count2&":"&"H"&$Count2+11,Default, Default, Default, False)
2. This worked...but could not change the font color.
       if FileExists("C:testimage"&""& $bitmap) Then
            _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $bitmap,"J"&$Count1)
         Else
        _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet,"NG","B"&$Count2)
      EndIf
Now I can write NG.....but want to change font color...and if possible make it bold.

Thanks in advance

Link to comment
Share on other sites

  1. Correct. Did you test? What was the result?
  2. Setting font properties is out of the scope of this UDF. I haven't yet found a sensible way to include this

    So you have to do it yourself:

    $oWorkbook.Activesheet.Range("B" & $Count2).Font.Bold = True
    ; $iColor is either a Colorindex (1-255) or a hex value (RGB colors)
    If $iColorIndex < 255 Then
        $oWorkbook.Activesheet.Range("B" & $Count2).Font.ColorIndex = $iColor
    Else
        $oWorkbook.Activesheet.Range("B" & $Count2).Font.Color = $iColor
    EndIf

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...