Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Okay - it seems I haven't explained myself properly, so:
Would someone show me a VBA example of: 1. Open "C:\mywork.xls" using the Excel.Appliction object 2. Enter "Hello World" into cell A1 3. Releasing connections to the open xls-file, but leaving it open for further work. 4. The code should be able to be re-run an infinite number of times, each time opening "C:\mywork.xls" in a new instance of Excel. Help greatly appreciated! Thx in advance. /Snedker |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub testit()
Dim app As Application, wkb As Workbook, i As Long For i = 1 To 3 Set app = New Application app.Visible = True Set wkb = app.Workbooks.Open("C:\mywork.xls") wkb.Worksheets(1).Cells(1, 1) = "Hello World" Set wkb = Nothing Set app = Nothing Next End Sub Keep in mind that the second time you open mywork.xls it will be read-only (unless it's a shared workbook) "Snedker" wrote in message ... Okay - it seems I haven't explained myself properly, so: Would someone show me a VBA example of: 1. Open "C:\mywork.xls" using the Excel.Appliction object 2. Enter "Hello World" into cell A1 3. Releasing connections to the open xls-file, but leaving it open for further work. 4. The code should be able to be re-run an infinite number of times, each time opening "C:\mywork.xls" in a new instance of Excel. Help greatly appreciated! Thx in advance. /Snedker |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Snedker,
How much memory has your system got? It must be infinite, if you're hoping to open an infinite number of instances of Excel!! HTH Henry "Snedker" wrote in message ... Okay - it seems I haven't explained myself properly, so: Would someone show me a VBA example of: 1. Open "C:\mywork.xls" using the Excel.Appliction object 2. Enter "Hello World" into cell A1 3. Releasing connections to the open xls-file, but leaving it open for further work. 4. The code should be able to be re-run an infinite number of times, each time opening "C:\mywork.xls" in a new instance of Excel. Help greatly appreciated! Thx in advance. /Snedker |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 26 Dec 2003 22:07:35 -0000, "Henry"
wrote: Well, you shouldn't take it literally :-) My VB-app will open the workbook and enter data automatically. They should be able to return to the VB-app push a button and a new instance of the workbook will be opened. The workbook is initially read-only, so they're supposed to save to a new filename anyway. "Several times" would be a more appropiate choice of words, rather than "infinite". Regards /Snedker Snedker, How much memory has your system got? It must be infinite, if you're hoping to open an infinite number of instances of Excel!! HTH Henry |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You may want to check
Office Application Automation http://msdn.microsoft.com/library/de...l=/library/en- us/modcore/html/deconAutomatingOtherOfficeApplications.asp and Creation of Object Variables to Automate Another Office Application http://msdn.microsoft.com/library/de...l=/library/en- us/modcore/html/deconCreatingObjectVariableToAutomateAnotherOffice Appli cation.asp While there check out other related topics shown in the left hand navigation bar. -- Regards, Tushar Mehta, MS MVP -- Excel www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , morten@ [nospam_]dbconsult.dk says... Okay - it seems I haven't explained myself properly, so: Would someone show me a VBA example of: 1. Open "C:\mywork.xls" using the Excel.Appliction object 2. Enter "Hello World" into cell A1 3. Releasing connections to the open xls-file, but leaving it open for further work. 4. The code should be able to be re-run an infinite number of times, each time opening "C:\mywork.xls" in a new instance of Excel. Help greatly appreciated! Thx in advance. /Snedker |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application not closing with mouse click??? | Excel Discussion (Misc queries) | |||
closing the application | Excel Discussion (Misc queries) | |||
Closing a workbook exits Excel Application | Excel Discussion (Misc queries) | |||
Excel still running in task manager after closing the application | Excel Discussion (Misc queries) | |||
Problem with closing the excel application | Excel Programming |