Click here to Skip to main content
16,016,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Good Morning.

I want to ask something but before that I tried to find the possible answer before doing it. Here it goes based on the link below.

https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=42794

It transfers Image from VB6 to Calc, My question is how can I do it Vice Versa? But this time in OpenOffice SpreadSheet.
To make the story short here is my goal.

How can I transfer Image from SpreadSheet into an Image or Picturebox Control? How can I do it in Loop? So get the Image and transfer it in my VB6 ImageBox for every Image. Thats my Goal atleast the transferring only. I will do the loop. I hope someone bear with my problem and TYSM. :( :( :(

This is my code but its not working.

C#
Dim objServiceManager As Object
  Dim objDesktop        As Object
  Dim objDocument       As Object
  Dim objText           As Object
  Dim objCursor         As Object
  Dim oDoc              As Object
  Dim ARG()
  Dim oGraph    As Object
  Dim oView     As Object
  Dim oDrawPage As Object
  Dim oSheet    As Object
  Dim Image     As System_Drawing.Image
  Dim oimage As Object
  Dim osize As Object

  Set objServiceManager = CreateObject("com.sun.star.ServiceManager")
  Set objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop")
  Set oDoc = objDesktop.loadComponentFromURL("file:///C:\Users\paul\Desktop\Testing.ods", "_blank", 0, ARG())
  Set oSheet = oDoc.getSheets().getByIndex(0)
  Set oGraph = oDoc.createInstance("com.sun.star.drawing.GraphicObjectShape")
  Set oView = oDoc.CurrentController
  Set oDrawPage = oView.getActiveSheet.DrawPage


  For i = 0 To 2
      For j = 0 To 9
         ' Form1.Image1.Picture = Clipboard.GetData

          Form1.Image1.Picture = LoadPicture(oDrawPage)
      Next
  Next


What I have tried:

I have tried my best to search and come up with the code above
Posted
Comments
CHill60 5-Dec-16 11:09am    
"its not working" is not helpful. What is it doing or not doing that is wrong? (Be specific)
Assault Cuirass 6-Dec-16 19:11pm    
Sir please see my post I already stated my problem I just want to transfer image from calc openoffice to vb6
CHill60 10-Apr-17 5:38am    
No, you have not stated your problem. You have stated what you want to happen and said "This is my code but its not working". "Not working" does not help us to help you because that statement tells us nothing at all.
By the way, to reply to a comment use the  Reply  button ... that way I would have been informed that you had responded 4 months ago.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900