473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Convertion of VB in Java

Can any body convert tis VB code in Java,

' quotation Macro
' Macro compiled 15 March 2002 by Syed Raza Haider
'
' Keyboard Shortcut: Ctrl+q
'
' ***************** UNPROTECTION OPERATION *****************
Sub quotation()

Sheets("Quotation").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Plan Features").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Census").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Hospitalisation").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Maternity").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Outpatient").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Outpatient - Family").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Critical Illness").Select
Range("A1").Select
ActiveSheet.Unprotect

Sheets("Major Medical").Select
Range("A1").Select
ActiveSheet.Unprotect

' ***************** DATABASE UPDATION *****************
Sheets("Quotation").Select
ChDir "C:\Documents and Settings\hammad\Desktop\New Folder"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Table_pa.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_CA.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_CB.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_CC.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_CD.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_CE.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_CF.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_CG.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\plan_cil.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_HA.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_HB.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_HC.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_HD.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_HE.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_HF.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_HG.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\plan_hos.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MMA.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\plan_MM.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MMB.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MMC.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MMD.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MME.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MMF.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MMG.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MA.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\plan_mat.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MB.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MC.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MD.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_ME.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MF.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_MG.dbf"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_OA.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_OB.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_OC.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_OD.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Plan_OE.DBF"
Workbooks.Open Filename:="C:\Documents and Settings\hammad\Desktop\New Folder\Planopat.DBF"

ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close
ActiveWindow.Close

' *************** AUTO-FIT OPERATION WITH PARAMETERS SHEET ***************

Sheets("Plan Features").Select
Cells.Select
Selection.Columns.AutoFit
Range("A1").Select

Sheets("Census").Select
Cells.Select
Selection.Columns.AutoFit
Range("A1").Select

' ***************** QUOTATION DEFAULT VALUE INPUT *****************

Sheets("Quotation").Select
Range("H7:H11").Select
Selection.ClearContents

Range("D19").Select
ActiveCell.FormulaR1C1 = "1"
Range("D20").Select
ActiveCell.FormulaR1C1 = "1"
Range("D21").Select
ActiveCell.FormulaR1C1 = "1"
Range("D22").Select
ActiveCell.FormulaR1C1 = "1"
Range("D23").Select
ActiveCell.FormulaR1C1 = "1"

' ***************** OUTPATIENT FAMILY DEFAULT VALUE INPUT *****************
Sheets("Outpatient - Family").Select
Range("c6:d12").Select
Selection.ClearContents
' ***************** CENSUS DEFAULT VALUE INPUT *****************
Sheets("Census").Select
Range("C8").Select
ActiveCell.FormulaR1C1 = "0"
Range("C9").Select
ActiveCell.FormulaR1C1 = "0"
Range("C10").Select
ActiveCell.FormulaR1C1 = "0"
Range("C11").Select
ActiveCell.FormulaR1C1 = "0"
Range("C12").Select
ActiveCell.FormulaR1C1 = "0"
Range("C13").Select
ActiveCell.FormulaR1C1 = "0"
Range("C14").Select
ActiveCell.FormulaR1C1 = "0"
Range("C15").Select
ActiveCell.FormulaR1C1 = "0"
Range("C16").Select
ActiveCell.FormulaR1C1 = "0"
Range("C17").Select
ActiveCell.FormulaR1C1 = "0"
Range("C18").Select
ActiveCell.FormulaR1C1 = "0"

Range("C18").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("D8:F8").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("C8").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("I8").Select
ActiveSheet.Paste
Range("C26").Select
ActiveSheet.Paste
Range("I26").Select
ActiveSheet.Paste
Range("C45").Select
ActiveSheet.Paste
Range("I45").Select
ActiveSheet.Paste
Range("C63").Select
ActiveSheet.Paste
Range("A1").Select

' ************** HIDDING / AUTO-FIT OPERATION WITH PREMIUM SHEETS **************

Sheets("Hospitalisation").Select
Cells.Select
Selection.Columns.AutoFit
Range("C1").Select
Selection.EntireColumn.Hidden = True
Range("J1").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select

Sheets("Maternity").Select
Cells.Select
Selection.Columns.AutoFit
Range("C1").Select
Selection.EntireColumn.Hidden = True
Range("G1").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select

Sheets("Outpatient").Select
Cells.Select
Selection.Columns.AutoFit
Range("C1").Select
Selection.EntireColumn.Hidden = True
Range("J1").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select

Sheets("Critical Illness").Select
Cells.Select
Selection.Columns.AutoFit
Range("C1").Select
Selection.EntireColumn.Hidden = True
Range("J1").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select

Sheets("Major Medical").Select
Cells.Select
Selection.Columns.AutoFit
Range("C1").Select
Selection.EntireColumn.Hidden = True
Range("J1").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select

Sheets("Quotation").Select
Columns("D:D").Select
Selection.Columns.AutoFit

' ***************** COLUMN WIDTH SETTING *****************

Sheets("Hospitalisation").Select
Range("D8:G8,K8:N8").Select
Range("K8").Activate
Selection.ColumnWidth = 16
Range("A1").Select

Sheets("Maternity").Select
Range("D8,H8").Select
Range("H8").Activate
Selection.ColumnWidth = 16
Range("A1").Select

Sheets("Outpatient").Select
Range("D8:G8,K8:N8").Select
Range("K8").Activate
Selection.ColumnWidth = 16
Range("A1").Select

Sheets("Critical Illness").Select
Range("D8:G8,K8:N8").Select
Range("K8").Activate
Selection.ColumnWidth = 16
Range("A1").Select

Sheets("Major Medical").Select
Range("D8:G8,K8:N8").Select
Range("K8").Activate
Selection.ColumnWidth = 16
Range("A1").Select

Sheets("Census").Select
Range("C8:F8,I8:L8").Select
Range("I8").Activate
Selection.ColumnWidth = 12
Sheets("Quotation").Select
Range("C25:L25").Select
Selection.ColumnWidth = 16

' ***************** RE-PROTECTION OPERATION *****************

Sheets("Quotation").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Plan Features").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Census").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Hospitalisation").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Maternity").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Outpatient").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Outpatient - Family").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Critical Illness").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Major Medical").Select
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("Quotation").Select
Range("A1").Select
End Sub
Jun 4 '07 #1
1 1390
prometheuzz
197 Expert 100+
Can any body convert tis VB code in Java,

...
There is no easy conversion between VB Script and Java possible.

I see you're reading an Excel file and updating an (old!) DBF file. Here's where you could start:

Reading Excel:
Jakarta POI: http://jakarta.apache.org/poi/

Reading writing DBF files:
A 3rd party lib like javadbf: https://javadbf.dev.java.net/ (never used it though!)
Jun 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Petr Studenovsky | last post by:
Hello I made small GUI test program in Visual Basic NET for SQL communication. I need some help with these problems. problem 1) If I change some settings in datagrid from properties window...
0
by: Konstantin Kivi | last post by:
I have problems getting character set convertion to work in 4.1.4 gamma under linux. Can sombody point me to the online recource other than standard MySQL doc so that I get more information.
6
by: Chiller | last post by:
I'm in the process of writing a class that performs functions on a Distance object. The object is created by entering details as "Distance a (5, km)" or "Distance b (3, cm)" etc. I wish to write...
1
by: Vidar | last post by:
I have a problem in dotNET XSL convertion object. (XMLTRANSFORM) It won't convert UTF-8 to ISO-8859-1 I use this stylesheet for konvertion: <?xml version="1.0" encoding="ISO-8859-1"?> <!--...
0
by: McKoy | last post by:
Hi, I'm translating some code from C++ to C#, but I don't know how to change the code below to get it working under C# ...., I've tried explicity convertion, but without any results :( Please...
4
by: juli | last post by:
Good afternoon! I have an error while trying to convert to DateTime ,here is the code and the error: ArrayList al = new ArrayList(); temp_str=Line.Split(' '); al.Add(temp_str); //...
8
by: juli | last post by:
I am trying to convert an object of a class which is derived from collectionbase class.It's not working: while ((line = file.ReadLine()) != null && line.IndexOf(" ")!=-1) { al.Add(line); }...
0
by: isore | last post by:
Convertion php to asp.net : PB lecture fichier .ini URGENT URGENT URGENT URGENT URGENT URGENT J'ai un code en php (http://parisports.free.fr) mais le client veut le même en asp.net J'ai...
1
by: jispullat | last post by:
Hi How I get an intiger or number data from an access database and can I use this data as int type data in java program
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.