Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to manupulate MS Excel in Vbscript? 2

Status
Not open for further replies.

Puneet

Programmer
Jul 10, 2000
1
US
I've been trying to use Createobject(Excel.Application)<br><br>but after this how do I manipulate workbooks, sheets, populate data in the cells and save them from the vbscript.
 
Here is an example code.&nbsp;&nbsp;It opens excel, adds a workbook, then makes it visible.&nbsp;&nbsp;When you use the createobject, it defaults to visible = false.&nbsp;&nbsp;You can set the range and manipulate data as shown.&nbsp;&nbsp;It is very similar to VBA for the manipulation commands.<br><br>&nbsp;&nbsp;Set MSExcel = createobject(&quot;Excel.application&quot;)<br>&nbsp;&nbsp;MSExcel.Workbooks.add<br>&nbsp;&nbsp;MSExcel.visible = true<br>&nbsp;&nbsp;MSExcel.range(&quot;D1&quot;).columnwidth = 50<br>&nbsp;&nbsp;MSExcel.range(&quot;A1&quot;).activate<br>&nbsp;&nbsp;MSExcel.activecell.value = &quot;A1&quot;<br>&nbsp;&nbsp;MSExcel.activecell.offset(0,1).activate<br>&nbsp;&nbsp;MSExcel.activecell.value = &quot;B1&quot;<br><br>Hope that Helps<br><br>Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top