INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

vbs -> C# organizational question

vbs -> C# organizational question

(OP)
I have a ton of Utility classes in vbscript, ie excelUtils would have methods such as isRowEmpty and gotoCell

CODE --> vbscript

Public Sub isRowEmpty (byval iRow)
	Dim xlObj : set xlObj = eval("getobject(,""Excel.Application"")")		
	Dim actWS : Set actWS = xlObj.ActiveWorkbook.ActiveSheet

	cell = "A" & iRow
	actWS.range(cell).Activate
	isRowEmpty = false
	If xlObj.CountA(xlobj.ActiveCell.EntireRow)=0 Then isRowEmpty = true
		
	set actWS = nothing	
	set xlObj = nothing
End Sub 

Public Sub gotoCell (byval setCell)
	Dim xlObj
	Dim actWS	
	Set xlObj = eval("getobject(,""Excel.Application"")")		
	Set actWS = xlObj.ActiveWorkbook.ActiveSheet

	actWS.range(setCell).Activate
	set actWS = nothing
	set xlObj = nothing
End Sub 
Similar things for getting getting and setting regKeys, get IP address, etc.
Working on creating a new framework in C#. Experts, does it make sense to carry forward these sort of classes, or just call it straight, ie use Microsoft.Office.Interop.Excel methods directly where applicable? thanks in advance!

RE: vbs -> C# organizational question

Stick it in a class. Is it just Excel you are handling or do you have to do word as well?

Note that if you are using COM as the VBScript is, you musn't touch the keyboard or change the focus while the code is running. Also, you will see the cursor moving all over the ribbon - this cannot be switched off, even if the ribbon is minimized.

RE: vbs -> C# organizational question

(OP)
Yes, word and ppt will get included in the libraries as well. guessing a namespace of officeProducts,and a class for each product would suffice. Thanks for the heads up on the focus and cursor movement.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close