473,398 Members | 2,403 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,398 software developers and data experts.

VB Output in Exel

How can I change the code to give the output in exel sheet or text file.
The code look like this:
Expand|Select|Wrap|Line Numbers
  1. Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
  2. strComputer = "."
  3. strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
  4. strEntry1a = "DisplayName"
  5. strEntry1b = "QuietDisplayName"
  6. strEntry2 = "InstallDate"
  7. strEntry3 = "VersionMajor"
  8. strEntry4 = "VersionMinor"
  9. strEntry5 = "EstimatedSize"
  10.  
  11. Set objReg = GetObject("winmgmts://" & strComputer & _
  12.  "/root/default:StdRegProv")
  13. objReg.EnumKey HKLM, strKey, arrSubkeys
  14. WScript.Echo "Installed Applications" & VbCrLf
  15. For Each strSubkey In arrSubkeys
  16.   intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
  17.    strEntry1a, strValue1)
  18.   If intRet1 <> 0 Then
  19.     objReg.GetStringValue HKLM, strKey & strSubkey, _
  20.      strEntry1b, strValue1
  21.   End If
  22.   If strValue1 <> "" Then
  23.     WScript.Echo VbCrLf & "Display Name: " & strValue1
  24.   End If
  25.   objReg.GetStringValue HKLM, strKey & strSubkey, _
  26.    strEntry2, strValue2
  27.   If strValue2 <> "" Then
  28.     WScript.Echo "Install Date: " & strValue2
  29.   End If
  30.   objReg.GetDWORDValue HKLM, strKey & strSubkey, _
  31.    strEntry3, intValue3
  32.   objReg.GetDWORDValue HKLM, strKey & strSubkey, _
  33.    strEntry4, intValue4
  34.   If intValue3 <> "" Then
  35.      WScript.Echo "Version: " & intValue3 & "." & intValue4
  36.   End If
  37.   objReg.GetDWORDValue HKLM, strKey & strSubkey, _
  38.    strEntry5, intValue5
  39.   If intValue5 <> "" Then
  40.     WScript.Echo "Estimated Size: " & Round(intValue5/1024, 3) & " megabytes"
  41.   End If
  42. Next
Apr 10 '07 #1
1 1841
tifoso
41
If I'm right u r trying to print out the info read from a registry section, if u write it with a comma separated format and name it foobar.csv u should be good to go as excel will read it in. More esoteric if u open an Excel object and play with the methods but this has worked for numerous requests I had i the past.

Just open a file for writing and carry on looping thru your hit-results

Ciao

Becker
Apr 11 '07 #2

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

Similar topics

2
by: Martijn van Exel | last post by:
Hi all, I'm receiving output from a webservice formatted as follows: <?xml version="1.0" encoding="utf-8"?> <DataSet xmlns="http://tempuri.org/adrloc/levering"> <xs:schema...
1
by: Tom | last post by:
> > Ciao a tutto il NG. > > Access 97 > > Devo poter inserire un record vuoto in una maschera a schede continua > cioč. > > record 1 > > record 2 > > record 3 > > record 4 > > record 5 > >...
0
by: Hendri | last post by:
My company have any report with ms exel , My question is how to make a web application with asp.net that can join with all office fitur. and i want to save the spread sheet by day, so if my boss...
2
by: Sylvain GENTIN | last post by:
Hi I try to bring back to exel a string computed by VB macro function. --------------------------------------------------------- Function CameoFilter(FileName As String, ByRef TextLine As...
0
by: newbie | last post by:
i'm a newbie of c language. can anyone help me to implement the code so that I can get the ciphertext from the output. thanks. #ifndef _3DES_H #define _3DES_H #ifndef uint8 #define uint8 ...
1
by: hatric | last post by:
HI i am novice to EXel and now using it, but i hav some probles in using it as database plz help viz. i am gettiing data from my colugues in exel form weekly basis and merg them in one exel sheet...
4
by: shahpalakr | last post by:
How we can do the connectivity of .Net to Exel. Please give me some basic consept abt this like basic syntax. Thanks.
3
by: chris01 | last post by:
I am tired of building tables from scratch in html and want to know if there is a way to build an exel document and somehow imbed the table into the html, either through php or java. I dont want...
0
by: aramya | last post by:
i have to transfer an image and data from the exel sheet to power point slide using visual basic. can anyone please help how it can be done
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.