extracting cell values in open office calc to set variables in VB.net - vb.net

Im intrested in finding out how i can add and extract cell values in open office calc using VB.net
dose anybody know any good refrences online to help me get started

The first think you need is the OpenOffice SDK. Here is that link: http://download.openoffice.org/other.html#tested-sdk
Now, most of the examples are written in JAVA and C++. However, there are several sites out there that have utilities or example code for porting to VB.NET. However, you should really learn about UNO with Open Office through this link here: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide.
Use the guide in tandem with any control or interface you use so that you have a clear understanding of what you are attempting to do. Here is an thread from another site that shows some example code: http://user.services.openoffice.org/en/forum/viewtopic.php?f=25&t=15504

Related

VB.Net - Are Windows Forms Allowed in Classes?

Hello once again StackOverflow community!
I have a fairly simple questions but surprisingly I am unable to find this answer while using google for the past hour...
Question is: Can you create a Form inside a Class Library, or in other words can I have my DLL(Class Library) create a form programmatically?
I am working on a Updater for a application a few friends and I use and I constantly find myself making small changes and tweaks in the code the more we use it so it would be nice to be able to update it with less effort on my part.

Office VBA macro is being compiled?

I am trying to figure out if the VBA code running in microsoft office is being compiled (to some intermediate language like MSIL) or is it an interpreter based language interpreting the VBA itself.
I tried to find a straight answer on the net and could find anything clear. I tried to find an API that "compiles" the VBA, but I did find any (and that does not mean the code is not being compiled).
Does anyone know what is going on in the internals, or at least an idea on how to check it out?
I'm not sure if this is what you're explicitly looking for, but I managed to find this...
"Code written in VBA is compiled to a proprietary intermediate language called P-code (packed code), which the hosting applications (Access, Excel, Word, Outlook, and PowerPoint) store as a separate stream in COM Structured Storage files (e.g., .doc or .xls) independent of the document streams. The intermediate code is then executed[1] by a virtual machine (hosted by the hosting application)."
From the following wiki page..
http://en.wikipedia.org/wiki/Visual_Basic_for_Applications
More info on P-Code..
http://en.wikipedia.org/wiki/Microsoft_P-Code
Hope this helps!

Can I use My.Computer.Network.DownloadFile in an access db?

I'm trying to download a file from the internet by clicking a button in MS Access.
I'm trying to use My.Computer.Network.DownloadFile as described here:
http://msdn.microsoft.com/en-us/library/1say4ws7(v=vs.80).aspx
Private Sub Command2_Click()
My.Computer.Network.DownloadFile("http://www.example.com/temp/xml_test.xml", "C:\xml_test.xml")
End Sub
but the 'Microsoft Visual Basic for Applications' IDE that I'm typing this into seems to have no idea what I'm talking about (text just turns red).
Can I just not do this through the built in VB editor or can I simply load a library or something to make it work?
Sorry but I'm very new to VB and to Access so search results are not specific enough for me to understand - lord knows I've tried.
I'm using Access 2010 but the DB was created in an previous version - not sure if that matters.
You can't use any .NET libraries in Access/VBA.
I recommend you check out Pearson's code for downloading files, posted on his website. It says it's written for Excel but it should work in Access. http://www.cpearson.com/excel/DownloadFile.aspx
To contradict my first statement, technically there are actually a few .Net libraries that can be called from VBA if you know how to do it (late binding only, for one thing). I'm having trouble finding the information on that right now. And I somewhat doubt that the library you're trying to use here is one of them. If I remember correctly, some of the encryption library can be used in VBA.

Is there an $end$ version in vb.net for snippets?

I'm making some snippets and i want to position the cursor. I've come acros "$end$" but all examples i see are in c#. Since recently i've started programming in vb.net again and it seems $end$ isn't recognized or doesn't work here. Is there another keyword in vb to do the same?
thanks in advance.
To the best of my knowledge, no. MSDN doesn't do the best job of documenting the meta-languages of snippets so reverse engineering tends to be the best way to figure things out. Looking through all of the VB snippets I can't find any usage of $selected$ or $end$. When I insert Microsoft-created snippets in VB I also can't press enter to go to the inside of my snippets like I can in C#.
If you install SharpDevelop, it has a translator that will convert C# code to VB.NET.
Just open a .cs file and then Tools->Convert to->VB.NET

Using the Office Interop for Word and Outlook 2007 in VB.NET

I need interop in my programs to automate several functions in Word and Outlook. Does anyone know a good place to start. My goal is to kick off a mail merge, create several different files and save them accordingly, then e-mail the different files to different people based upon who needs what. Any help learning how to use the interop properly would be greatly appreciated.
I am currently using Visual Studio 2008 and Office 2007 and use vb.net to write my programs.
A good way to get started is to use the macro editor to record the steps you are trying to perform. You can take the generated macro code and modify it for your purposes to suit. Click on the names of functions and variables of which you do not know the purpose and hit "F1" to get context specific help.
Add COM references to Outlook 12.0 Object library and Word 12.0 Object library.
This web page really helped kick me off: http://support.microsoft.com/kb/316383
Then, by recording macros you'll expose a lot of the stuff you'll likely want to work with. Word of warning, however, is that not everything exposed in VBA (macros) is accessible within VB .NET. I don't know why this is, but I've actually had to construct and execute a macro from VB.NET, written in VBA, within Excel to accomplish something that seemed ridiculously easy if it weren't for the strange disconnect between the two.
Some good info on Mail Merge: http://support.microsoft.com/kb/258512
Here's an article with some basic steps to get you up and connected with Outlook's Interop: http://support.microsoft.com/kb/313787
Hope this helps. I'll keep an eye out for questions from you here--I'd say I know quite a bit when it comes to interop.
You might want to start here: http://msdn.microsoft.com/en-us/office/bb266408.aspx.
There are a number of tutorials.