Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002: Opening related files by clicking file address Mr. Low Excel Discussion (Misc queries) 2 July 31st 09 06:47 PM
Opening files by double clicking takes for ever - Word, Excel Scott Townsend Setting up and Configuration of Excel 3 July 31st 08 01:17 PM
Running Macros from Command line DrukeEr Excel Programming 3 July 26th 05 06:03 PM
Running a macro from a command line Kelly Excel Programming 4 November 30th 04 08:17 PM
Running a macro from the command line Czech Excel Programming 1 October 28th 04 09:51 PM


All times are GMT +1. The time now is 08:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"