+ Reply to Thread
Results 1 to 3 of 3

need help in writing a vba script to run a macro (.xlam file) on a .csv file

  1. #1
    Registered User
    Join Date
    03-27-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    53

    Lightbulb need help in writing a vba script to run a macro (.xlam file) on a .csv file

    Hi,

    i have a marco in .xlam format and a .csv file both in the same folder, i am trying to do is write a vba script to be able to run the macro on the .csv file.

    Here is the code i have tried so far...

    Sub Main

    Dim objExcel As Object
    Dim objWorkBook As Object
    Dim objWorkBook2 As Object
    Dim objWS As Object


    Set objExcel = CreateObject("Excel.Application")
    Set objWorkBook = objExcel.Workbooks.Open("C:\Documents and Settings\auxservices\Desktop\Test Aux Automation\Macro_BIC_Roster_test.xlam")
    Set objWorkBook2 = objExcel.Workbooks.Open("C:\Documents and Settings\auxservices\Desktop\Test Aux Automation\CNP_POWERSCHOOL_ENROLLMENT.csv")

    objExcel.Application.Run ("CNP_POWERSCHOOL_ENROLLMENT.csv!BIC_roster_test")



    End Sub


    I was getting an error 1004 Cannot run the macro CNP_POWERSCHOOL_ENROLLMENT.csv!BIC_roster_test.The macro may not be available in this workbook or all macros may be disabled.


    Any help please.... iam very new to this scripting.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: need help in writing a vba script to run a macro (.xlam file) on a .csv file

    So what exactly should the macro do to the file?
    If someone has helped you then please add to their Reputation

  3. #3
    Registered User
    Join Date
    03-27-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    53

    Re: need help in writing a vba script to run a macro (.xlam file) on a .csv file

    The macro creates 18 excel and 18 pdf files automatically.

+ 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. script to run the macro from Vb script with out opening the excel file
    By chandanp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2021, 03:33 AM
  2. [SOLVED] XLAM file add-in
    By ammartino44 in forum Excel General
    Replies: 4
    Last Post: 01-15-2015, 02:03 PM
  3. [SOLVED] Excel 2007-Customize the Ribbon using a xlam file instead of a xlsm file.
    By oteixeira in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2013, 12:31 PM
  4. Excel 2010 Add In - .xlam file - macro thro custom tool bar button
    By chetan.thakkar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2013, 10:58 AM
  5. Replies: 6
    Last Post: 05-29-2012, 04:25 AM

Tags for this Thread

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