Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
I/O and Streams
VBScript to Java
George Sarbu
Greenhorn
Posts: 6
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello !
I want to convert the following script(Visual Basic Script) in a
Java
application(with GUI):
'open Excel file Set objDialog = CreateObject("UserAccounts.CommonDialog") objDialog.Filter = "Excel|*.xls|All Files|*.*" objDialog.FilterIndex = 1 objDialog.InitialDir = "D:\" 'directorul in care se cauta intResult = objDialog.ShowOpen 'afiseaza fereastra 'Open' If intResult = 0 Then Wscript.Quit Else Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open(objDialog.FileName) End If objExcel.Visible = True Set objWorksheet2 = objWorkbook.Worksheets("Sheet1") objWorksheet2.Activate 'calcul intRow = 2 Do Until objExcel.Cells(intRow,1).Value = "" objExcel.Cells(intRow,4).Value = 1.001685e-04 + objExcel.Cells(intRow,1).Value * (-1.120083e-06 + objExcel.Cells(intRow,1).Value * 6.536332e-09) objExcel.Cells(intRow,5).Value = 999.842594 + objExcel.Cells(intRow,1).Value * (6.793952e-02 + objExcel.Cells(intRow,1).Value * (-9.095290e-03 + objExcel.Cells(intRow,1).Value * objExcel.Cells(intRow,4).Value)) objExcel.Cells(intRow,6).Value = 7.6438e-05 + objExcel.Cells(intRow,1).Value * (-8.2467e-07 + objExcel.Cells(intRow,1).Value * 5.3875e-09) objExcel.Cells(intRow,7).Value = 0.824493 + objExcel.Cells(intRow,1).Value * (-4.0899e-03 + objExcel.Cells(intRow,1).Value * objExcel.Cells(intRow,6).Value) objExcel.Cells(intRow,8).Value = -5.72466e-03 + objExcel.Cells(intRow,1).Value * (1.0227e-04 - objExcel.Cells(intRow,1).Value * 1.6546e-06) objExcel.Cells(intRow,9).Value = 4.8314e-04 objExcel.Cells(intRow,10).Value = objExcel.Cells(intRow,5).Value + objExcel.Cells(intRow,2).Value * (objExcel.Cells(intRow,7).Value + objExcel.Cells(intRow,8).Value * Sqr(objExcel.Cells(intRow,2).Value) + objExcel.Cells(intRow,9).Value * objExcel.Cells(intRow,2).Value) intRow = intRow + 1 Loop objExcel.ActiveWorkbook.Save
The script open a dialog file, where user select a Excel file, and then start calculation.
Thank you very much in advance'
George
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
MindQ #36, regarding GC
whats wrong with my code ?
Integer.MIN_VALUE????
What will be the output.
Using fair or unfair ReentrantReadWriteLock aquisition order ?
More...