473,569 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB Output in Exel

2 New Member
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 1846
tifoso
41 New Member
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
1102
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 id="Bridgis_DataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas- microsoft-com:xml-msdata"> <xs:element name="Bridgis_DataSet"...
1
2855
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 > > record 6
0
1118
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 want to see a Tommorow Reports he can see it , sama like Crystal report ...?maybe that alls thanks....
2
1431
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 Variant) .... TextLine = ... End Function ---------------------------------------------------------
0
2056
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 unsigned char #endif
1
1379
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 by manualy , can i import and link many exel files data in one master file, plz suggest thanks hatric
4
1302
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
1314
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 to put a link, or open the exel file in a new window, I want it to look like it is part of the website. Any help would be apprecieated
0
922
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
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.