![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 3
|
Is there some way to pass a command line arguments to Excel ? I want Excel to open a specific file and apply a specific macro to the file. I plan on doing this via VB.
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
To open a specific spreadsheet from the cmd prompt just type in the full name.
- In word if you wanted to run a specific macor on opening you would use a /m switch .. so there is probably one for excel as well. However if you always want the same macro run when you open that specific workbook why not just drop the Macro into the "Private Sub Workbook_Open() event of that workbook? |
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Posts: 3
|
The worksheet is being created from VB.
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Hi ... I'm a pretty thick headed person so forgive me if I don't know exactly what you want.
Do you want to create a newwkbk and then copy a macro to it ? Do you want to create a newwkbk and then have the present workbook macro's make changes in the new one then save ? Do you want me just to leave you alone and have someone who's first language is english help you ?
__________________
<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee> |
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Posts: 3
|
You gave me a good reason to laugh, and for that I thank you.
Here's the scenario. I have a VB front end/Access back end. I am giving the user the ability to email a report (in Excel format). By default the report is too wide to print on one page. I'd like to run a macro on the file that contains the report so it's formatted correctly. I have the VB code for the macro all set up. All I need to do is figure out how in VB to run this macro after the Excel formatted document is exported out of my VB application. I thought I could save the macro "globally" so it's available to any other opened Excel document but I think I'm wrong. Another possibility is to record the macro after I've exported the report into the Excel formatted document, but i haven't figured out how to do that yet from VB. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|