Does anyone know how to duplicate the following VB code in PB?
Thanks,
Calvin
Code:
Range("A4").Select ActiveSheet.Pictures.Insert(sFile)
Calvin
DIM vRange AS VARIANT DIM vFile AS VARIANT vRange = "A4" vFile = sFile OBJECT CALL Range(vRange).Select OBJECT CALL ActiveSheet.Pictures.Insert(vFile)
vFile = sFile vLink = 1 vSave = 1 vLeft = 0 vTop = 50 vWidth = 32 vHeight = 32 Object Call oExcelWorkSheet.Shapes.AddPicture(vFile, vLink, vSave, vLeft, vTop, vWidth, vHeight)
'Add image to centre header LET vFile = "C:\PBWin90\Objects\pbsig.jpg" LET vVnt1 = "&G" OBJECT LET oExcelWorkSheet.PageSetup.CenterHeader = vVnt1 OBJECT LET oExcelWorkSheet.PageSetup.CenterHeaderPicture.Filename = vFile
Sub Macro1() ' ' Macro1 Macro ' Macro recorded 6/6/2011 by Michael Mattias ' ' Range("F1").Select ActiveSheet.Pictures.Insert( _ "C:\Documents and Settings\Michael\My Documents\My Pictures\ANSI_STANDARDS.bmp" _ ).Select Application.CommandBars("Stop Recording").Visible = False End Sub
'Part Number colum 3 > 3 IF EXCC& = 3 THEN LISTVIEW GET TEXT S2DLG, %IDC_LISTVIEW2, EXCR&, EXCC& TO TMP$ _ :LET vX = 3: LET vY = EXCR&+10 : LET vText1 = TMP$ _ :OBJECT LET oExcelWorkSheet.Cells.Item(vY, vX) = vText1 ' EXCC& Excel current column taken from listview2 ' EXCR& Excel current row taken from listview2 ' Obtain icon file number from listview to TMP$ ' Obtain icon file name from Array IcA and create a file path for the icon. VFile ' Add icon at coordinates X Y to be inside the target cell ' e.g 40 from left, 145 + (EXCR&*60) from top IF EXCC& = 3 THEN LISTVIEW GET TEXT S2DLG, %IDC_LISTVIEW2, EXCR&, 46 TO TMP$ _ :LET vFile = DRV$ + "Peprog\EstPBasic\" + TRIM$(IcA( VAL(TMP$) )) _ :LET vLink = 1 : LET vSave = 1 _ :LET vLeft = 40 : LET vTop = 145 + (EXCR&*60) _ :LET vWidth = 16 : LET vHeight = 16 _ :OBJECT CALL oExcelWorkSheet.Shapes.AddPicture(vFile, vLink, vSave, vLeft, vTop, vWidth, vHeight) ' A VB Macro ' Sub Macro1() ' ' Macro1 Macro ' Range("E6").Select ' ActiveSheet.Pictures.Insert("C:\Peprog\EstPBasic\Elec 3CoreCable22.ico").Select ' End Sub
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment