Link to home
Start Free TrialLog in
Avatar of fjkilken
fjkilken

asked on

Convert VBC code to C#

Hi
I have a small section of VBA code which I need to convert/rewrite in C#.
Basically the code specifies the count, name and location of images which are to be used in a gallery on a custom Excel Ribbon:

Sub getBSCGalleryItemImages(control As IRibbonControl, index As Integer, ByRef image)
    Set image = LoadPicture("//images/report_snapshot_" & index + 1 & ".jpg")
End Sub
Sub getBSCGalleryItemCount(control As IRibbonControl, ByRef count)
        count = 3
End Sub

Open in new window


Thanks for the help

Fergal
Avatar of SStory
SStory
Flag of United States of America image

It would be something like the following:
void getBSCGalleryItemImages(IRibbonControl control,int Index, ref image) {

    image = LoadPicture("//images/report_snapshot_" + int.parse(index + 1) + ".jpg");

}

void getBSCGalleryItemCount(IRibbonControl control, ref count) {

        count = 3;

}

Open in new window


Per your code I didn't know what type variable count was or Image, so those may have to be added.
Avatar of fjkilken
fjkilken

ASKER

doesn't look like that will work - "LoadPicture" method is not recognised
ASKER CERTIFIED SOLUTION
Avatar of SStory
SStory
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks,
let me take a look at incorporating that tomorrow