Connecting Tech Pros Worldwide Forums | Help | Site Map

Help regarding OpenOffice and VB

Newbie
 
Join Date: Oct 2007
Posts: 4
#1: Nov 28 '07
Hello All,

I am trying to code using Visual Basic to open OpenOffice calc application and manipulate with the cells. I am successful to a certain extent, however I am facing a problem formatting the cell..... for example, I want to draw borders to a cell. How can this be achieved??

Following is the code that I have written :

Expand|Select|Wrap|Line Numbers
  1. Function MakeCellBorderLine(nColor, nInnerLineWidth, nOuterLineWidth, nLineDistance) As Object
  2.     oBorderLine = createUnoStruct("com.sun.star.table.BorderLine")
  3.     With oBorderLine
  4.         .Color = nColor
  5.         .innerlinewidth = nInnerLineWidth
  6.         .outerlinewidth = nOuterLineWidth
  7.         .linedistance = nLineDistance
  8.     End With
  9.  
  10.     MakeCellBorderLine = oBorderLine
  11. End Function
  12.  
Whenever I compile my code it gives me an error that says : "User-defined type not defined". I have absolutely NO CLUE how to proceed. Can someone be of help???

Thanks a ton in advance..

Rgds,
SAM



Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,268
#2: Nov 29 '07

re: Help regarding OpenOffice and VB


Quote:

Originally Posted by samdotnetprogrammer

I am trying to code using Visual Basic to open OpenOffice calc application and manipulate with the cells ...

Please forgive me, I do not know how this can be handled. Have you searched here previously?

Good luck!

Dököll
Moderator
 
Join Date: Oct 2006
Location: Australia
Posts: 7,748
#3: Nov 29 '07

re: Help regarding OpenOffice and VB


Which line throws the error?
Newbie
 
Join Date: Dec 2007
Location: India
Posts: 3
#4: Dec 18 '07

re: Help regarding OpenOffice and VB


Hi All,

I am experiencing similar issues as faced by samdotnetprogrammer. Please could anyone tell the .dll that we need to use so that we could work on OpenOffice Excel / Word. Few hours back I saw a website that mentions the following dll:

1. OOWRITVB.DLL - For Text Docs. (OpenOffice)
2. OOCALCVB.DLL - For Excel. (OpenOffice)

I presume that once we add these two files in the references, we will be able to work just as we can work on Microsoft Excel after adding Microsoft Excel 11.0 Object Library.

Am I right? Please let me know.



Quote:

Originally Posted by samdotnetprogrammer

Hello All,

I am trying to code using Visual Basic to open OpenOffice calc application and manipulate with the cells. I am successful to a certain extent, however I am facing a problem formatting the cell..... for example, I want to draw borders to a cell. How can this be achieved??

Following is the code that I have written :

Expand|Select|Wrap|Line Numbers
  1. Function MakeCellBorderLine(nColor, nInnerLineWidth, nOuterLineWidth, nLineDistance) As Object
  2.     oBorderLine = createUnoStruct("com.sun.star.table.BorderLine")
  3.     With oBorderLine
  4.         .Color = nColor
  5.         .innerlinewidth = nInnerLineWidth
  6.         .outerlinewidth = nOuterLineWidth
  7.         .linedistance = nLineDistance
  8.     End With
  9.  
  10.     MakeCellBorderLine = oBorderLine
  11. End Function
  12.  
Whenever I compile my code it gives me an error that says : "User-defined type not defined". I have absolutely NO CLUE how to proceed. Can someone be of help???

Thanks a ton in advance..

Rgds,
SAM

Newbie
 
Join Date: Dec 2007
Location: India
Posts: 3
#5: Dec 18 '07

re: Help regarding OpenOffice and VB


Hi All,

I am experiencing similar issues as faced by samdotnetprogrammer. Please could anyone tell the .dll that we need to use so that we could work on OpenOffice Excel / Word. Few hours back I saw a website that mentions the following dll:

1. OOWRITVB.DLL - For Text Docs. (OpenOffice)
2. OOCALCVB.DLL - For Excel. (OpenOffice)

I presume that once we add these two files in the references, we will be able to work just as we can work on Microsoft Excel after adding Microsoft Excel 11.0 Object Library.

Am I right? Please let me know.

Regards,
VBHulk

Quote:

Originally Posted by samdotnetprogrammer

Hello All,

I am trying to code using Visual Basic to open OpenOffice calc application and manipulate with the cells. I am successful to a certain extent, however I am facing a problem formatting the cell..... for example, I want to draw borders to a cell. How can this be achieved??

Following is the code that I have written :

Expand|Select|Wrap|Line Numbers
  1. Function MakeCellBorderLine(nColor, nInnerLineWidth, nOuterLineWidth, nLineDistance) As Object
  2.     oBorderLine = createUnoStruct("com.sun.star.table.BorderLine")
  3.     With oBorderLine
  4.         .Color = nColor
  5.         .innerlinewidth = nInnerLineWidth
  6.         .outerlinewidth = nOuterLineWidth
  7.         .linedistance = nLineDistance
  8.     End With
  9.  
  10.     MakeCellBorderLine = oBorderLine
  11. End Function
  12.  
Whenever I compile my code it gives me an error that says : "User-defined type not defined". I have absolutely NO CLUE how to proceed. Can someone be of help???

Thanks a ton in advance..

Rgds,
SAM

Newbie
 
Join Date: Dec 2007
Location: India
Posts: 3
#6: Dec 18 '07

re: Help regarding OpenOffice and VB


Hi ALL,

I finally got what I needed. The following DLLs can be downloaded from the URL given below:

a. OOWRITVB.DLL
b. OOCALCVB.DLL

URL: http://pagesperso-orange.fr/hffm/m3.html

You can see version 1.00 written against the DLL names on the website:- OOWRITVB AND OOCALCVB. Download the zips. After extracting the zips, a folder named TEST would also be copied. Open this folder and you can see these DLLs. I would like to thank Amrut Koli, a senior engineer who assisted me in finding the DLLs.

Regards,
Thomas
lotus18's Avatar
Site Addict
 
Join Date: Nov 2007
Location: Zamboanga City, Philippines
Posts: 857
#7: Dec 18 '07

re: Help regarding OpenOffice and VB


Good job vbhulk

This is gonna be helpful to anyone with same problem like this.
Reply


Similar Visual Basic 4 / 5 / 6 bytes