Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default More help on closing Excel.Application

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default More help on closing Excel.Application

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default More help on closing Excel.Application

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default More help on closing Excel.Application

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default More help on closing Excel.Application

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
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
Application not closing with mouse click??? Faraz A. Qureshi Excel Discussion (Misc queries) 1 December 16th 09 02:08 PM
closing the application Tigger Excel Discussion (Misc queries) 1 September 24th 08 04:26 PM
Closing a workbook exits Excel Application DarS Excel Discussion (Misc queries) 2 September 27th 07 01:51 PM
Excel still running in task manager after closing the application Willem Excel Discussion (Misc queries) 0 December 5th 06 01:56 PM
Problem with closing the excel application guhan Excel Programming 1 August 20th 03 01:56 PM


All times are GMT +1. The time now is 04:58 PM.

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

About Us

"It's about Microsoft Excel"