Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 4th, 2007, 05:01 AM
Friend of Wrox
Join Date: Jan 2007
Location: durban, Africa, South Africa.
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default execute an excel macro via a .vbs file

Hi, i need help please.

I have a vbs file where i want to execute an excel macro on a file
i don't really know vb as i want to execute the file via cmdline.
i have a code i got off the net but it does not work.
Can anyone please help, Thanking you in anticipation

********* Code **********

Dim objExcel, objWb

On Error resume next

    sFilename = "c:\deals exceptions.asc"

    'Suppress errors and warnings
    Set objExcel = Wscript.CreateObject("Excel.Application")

    Set objWb = objExcel.WorkBooks.Open(sFilename)

   objExcel.run("C:\Documents and Settings\ismailc\Application Data\Microsoft\Excel\XLSTART\PERSONAL.XLS!Macro2")

objExcel.DisplayAlerts = True
Set objExcel = Nothing
Set objWb = Nothing


Reply With Quote
  #2 (permalink)  
Old January 11th, 2007, 04:19 PM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

What does happen when you run this? (Do you get an error message?)

What kind of file has a “.asc” extension? That’s not a workbook, is it?
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save a file in CSV format thru Excel VBA macro roli2712 Excel VBA 1 July 11th, 2007 03:05 AM
Execute VBS files via ASP.NET (VB.NET) Mario_Steiner ASP.NET 1.0 and 1.1 Professional 0 November 9th, 2005 07:49 AM
vb macro output file to excel mateenmohd VBScript 0 March 21st, 2005 12:34 AM
Execute *.exe in vbs kodakodu VBScript 1 November 22nd, 2004 03:33 AM
How do I execute / run an Access Macro Dean Hewitt Access ASP 0 February 11th, 2004 05:35 PM

All times are GMT -4. The time now is 06:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.