Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBs scripting for calling excel sreadsheet
Hi every1!!
Not sure if this is the right section for this but here goes: I want to right a vbs script that will call an excel template i created. That template as an Auto_Open macros that needs to be executed. Then i want to save that excel under diff name and close it. All this needs to be invisible to user, so i dont need to visually see the excel spreadsheet open up and everything.. Can this be done!!! Thx in advance for any help you can provide me with.. PAtrick |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBs scripting for calling excel sreadsheet
Set oWB = workbooks.open Filename:=name_of_file Application.Run "'" & oWb.Name & "'!Auto_Open" oWb.Close SaveChanges:=False Set oWB = Nothing -- HTH Bob Phillips "Patrick" wrote in message ... Hi every1!! Not sure if this is the right section for this but here goes: I want to right a vbs script that will call an excel template i created. That template as an Auto_Open macros that needs to be executed. Then i want to save that excel under diff name and close it. All this needs to be invisible to user, so i dont need to visually see the excel spreadsheet open up and everything.. Can this be done!!! Thx in advance for any help you can provide me with.. PAtrick |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBs scripting for calling excel sreadsheet
All air code but this should get you started.
Option Explicit Dim filePath1, filePath1, oExcel, oSheet filePath1 = "c:\Test.xlt" filePath2 = "c:\Test1.xls" Set oExcel = CreateObject("Excel.Application") oExcel.Workbooks.Open(filepath1) oExcel.Run "macro1" oExcel.DisplayAlerts = False oExcel.ActiveWorkbook.SaveAs filePath2 oExcel.Close(false, filePath1) oExcel.Close(false, filePath2) oExcel.Quit Set oExcel = Nothing -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Patrick" wrote: | Hi every1!! | | Not sure if this is the right section for this but here goes: | | I want to right a vbs script that will call an excel template i created. | That template as an Auto_Open macros that needs to be executed. | | Then i want to save that excel under diff name and close it. | All this needs to be invisible to user, so i dont need to visually see the | excel spreadsheet open up and everything.. | | Can this be done!!! | | Thx in advance for any help you can provide me with.. | | PAtrick |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBs scripting for calling excel sreadsheet
This is great everything is working now.
Thank you so much!! "Dave Patrick" wrote: All air code but this should get you started. Option Explicit Dim filePath1, filePath1, oExcel, oSheet filePath1 = "c:\Test.xlt" filePath2 = "c:\Test1.xls" Set oExcel = CreateObject("Excel.Application") oExcel.Workbooks.Open(filepath1) oExcel.Run "macro1" oExcel.DisplayAlerts = False oExcel.ActiveWorkbook.SaveAs filePath2 oExcel.Close(false, filePath1) oExcel.Close(false, filePath2) oExcel.Quit Set oExcel = Nothing -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Patrick" wrote: | Hi every1!! | | Not sure if this is the right section for this but here goes: | | I want to right a vbs script that will call an excel template i created. | That template as an Auto_Open macros that needs to be executed. | | Then i want to save that excel under diff name and close it. | All this needs to be invisible to user, so i dont need to visually see the | excel spreadsheet open up and everything.. | | Can this be done!!! | | Thx in advance for any help you can provide me with.. | | PAtrick |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBs scripting for calling excel sreadsheet
Glad to hear it. You're welcome.
-- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Patrick" wrote: | This is great everything is working now. | | Thank you so much!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
changes to sreadsheet that changes other sheets in same doc auto | New Users to Excel | |||
Selecting Random Records From an Excel Sreadsheet | Excel Worksheet Functions | |||
When I open an excel sreadsheet I have to x out twice. Why? | Excel Discussion (Misc queries) | |||
Open a .xls in micrsoft works sreadsheet | Excel Discussion (Misc queries) | |||
is excel by itself enough to do scripting? | Excel Programming |