|
-
Jan 25th, 2011, 07:05 AM
#1
Thread Starter
New Member
Noob: Migration Advice (long)
Hi all. Got what will seem like an unusual situation: almost no Windows experience, and an severely limited target user.
Basically I've been using VBA in Office 2007 to do some database stuff, data crunching, XML stuff, etc. I've been making little worksheets and macros on my own time, after work, and frankly haven't been learning much about Windows development in general.
No problem there, really, as long as I don't need to use any tool or development stuff that's not already installed on the machine. Yes, our IT department is that rigid. and pretty much staffed by people with no IT background. Hence, if it's not in our corporate installation, it doesn't exist. (I know that there are some add-ons that I can use in Excel like the RegEx object, so some minor mods can be possbile...). This is a tech-phobic company.
Up til now I've been okay with that. However I've been getting to the point where the lack of features like exception handling is bothering me, a lot.
Apparently I'm stuck with the VBA On On Error Goto, and (to my knowledge) can't implement an error-handling system that I like. (BTW, is there a way to pass a goto label as a variable to a function? Or are there preprocessor macros?).
Now VB.net seems to have all the features I want, such as exception handling, and inheritance, and so forth. However, I'm unsure has to how to develop and/or distribute anything in VB.net with our setup.
At home my Macs (yes, I'm from that side) have Windows running in a virtual box ready to go. Is it possible for me to develop in VB.net at home (via Visual Studio?) and make worksheets that I can run at work with our limited Office users? It seems like I would have to create some kind of external application in VB.net that would communicate with Excel (?) but I don't know if it's possible, or how to check for the capabilities I need.
Also, is the Mac version of Office relevant at all to this?

T-I-A
-
Jan 25th, 2011, 07:46 AM
#2
Re: Noob: Migration Advice (long)
As for the On Error Goto statement in VBA, you can equate it to a crude Try .. Catch block, where the Goto label makes up your Catch block.
Code:
Try
'Code
'Code
Catch (Ex As Exception)
'Error Handling
End Try
Code:
On Error Goto Err
'Code
'Code
Err:
If Error.Number <> 0 Then
'Error Handling
End If
.
-
Jan 25th, 2011, 08:29 AM
#3
Re: Noob: Migration Advice (long)
You can automate Excel from VB.NET. And if you keep it simple (stay away from 3rd party controls, just use the intrinsic windows controls) you will not even need a setup. You can just copy and paste the exe if the framework is equivalent.
The only part I'm not sure on is using Excel. I don't know if you would have to do any setup for it, but I wrote an app here that creates a spreadsheet in Excel that gets data from a database. I don't think I created a setup for that, but I don't remember.
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|