+ Reply to Thread
Results 1 to 7 of 7

vbscript to run excel marco

Hybrid View

  1. #1
    Registered User
    Join Date
    07-21-2013
    Location
    uae
    MS-Off Ver
    Excel 2007
    Posts
    5

    vbscript to run excel marco

    hi everyone,
    i'm trying to create o vbscript to run a macro in an opened workbook, i managed to create one but my problem in whenever i run the script the workbook get opened again even if it's already opened.
    can you help so i can be able to do the following,
    the workbook will be opened manual
    when i run the script a macro will run and update the cell "A1" by adding "1" cell value will be "2", if i run the script again cell "A1" will be "3" next run "5"....
    i don't need the script to save or close the workbook.
    bellow is the script i am using at the moment.

    Dim xlApp
    Dim xlWkb
    
    Set xlApp = CreateObject("excel.application")'
    Set xlWkb = xlApp.Workbooks.open ("C:\Users\elife\Desktop\project.xlsm")
    xlWkb.RunAutoMacros 1 'xlautoopen
    xlApp.Run ("table1")
    xlApp.Visible = True
    
    Set xlWkb = Nothing
    Set xlApp = Nothing
    thank you
    Attached Files Attached Files
    Last edited by alansidman; 10-27-2013 at 11:26 AM. Reason: code tags added

  2. #2
    Registered User
    Join Date
    10-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: vbscript to run excel marco

    Please upload a workbook with a clear

    explanation in the sheets itself by

    highlighting the cells, rows or columns where

    you want to get the help for with a remark if

    needed.



    Regards

  3. #3
    Registered User
    Join Date
    07-21-2013
    Location
    uae
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: vbscript to run excel marco

    Dear

    workbook uploaded

    thanks

  4. #4
    Registered User
    Join Date
    07-21-2013
    Location
    uae
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: vbscript to run excel marco

    no solution?? please help

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: vbscript to run excel marco

    Welcome to the forum.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them for you this time. Please read our rules and adhere to them in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Registered User
    Join Date
    07-21-2013
    Location
    uae
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: vbscript to run excel marco

    Dear Alan
    i am new in coding my code is saved in noetpade as VBS.

    Regards

  7. #7
    Registered User
    Join Date
    07-21-2013
    Location
    uae
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: vbscript to run excel marco

    please guy, have a look on this thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. query excel from vbscript
    By pelegk2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2009, 06:25 AM
  2. [SOLVED] Excel & VBScript
    By Bill Ebbing in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-08-2005, 02:05 PM
  3. [SOLVED] Using excel through vbscript
    By ashtom1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-06-2005, 11:05 AM
  4. VBScript and Excel Viewer can it be done?
    By MattyG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2005, 01:01 AM
  5. [SOLVED] vbscript - export to excel ???
    By amy_mgfe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-16-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1