Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command line used for opening .xls files and clicking abutton/running a function.
Ok, here's the thing:
- I have created a set of .xls files (around 150) - All of these are generated separately in .csv files that I use as scripts.. - Generating is done from inside each file using a "Generate" button linked to a function: Sub GenerateCsv_Click() Dim area As Range Dim OutBuffer As String Dim NumberOfLoops As Integer Dim MyActiveSheet As String Dim MyName As String Dim MyNameToPrint As String Dim MyPath As String Dim fname As String Dim ListOfScripts(255) As String Dim LastScript As Integer Dim i, j As Integer Dim UserPath As String Dim UserDrive As String Dim CreateMainfile As Boolean Dim Target_Esim As String On Error GoTo ErrorHandler The basic thing I searched for and I need actually is a way of creating a command line script which should open a .xls file and either click the Generate button which is linked to this function, either run the function itself.. I'll figure out a way of parsing through all the files and folders; just need a idea to work with first. Or some site with more info, like the Excel API (if that even helps). I've kept searching for the past two weeks for something that could help but to no avail. If anyone has some ideas/suggestions I'm all eyes and ears. Also, combining all the .xls files into a big one is not helpful, already tried that and generating ~170 takes a huge load on the system. Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command line used for opening .xls files and clicking abutton/running a function.
Ok, I finally found something I can work with:
Option Explicit On Error Resume Next ExcelMacroExample Sub ExcelMacroExample() Dim xlApp Dim xlBook Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Open("C:\MyWorkbook.xls", 0, True) xlApp.Run "MyMacro" xlApp.Quit Set xlBook = Nothing Set xlApp = Nothing End Sub ..vbs script which can be used. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2002: Opening related files by clicking file address | Excel Discussion (Misc queries) | |||
Opening files by double clicking takes for ever - Word, Excel | Setting up and Configuration of Excel | |||
Running Macros from Command line | Excel Programming | |||
Running a macro from a command line | Excel Programming | |||
Running a macro from the command line | Excel Programming |