Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel programming question

Status
Not open for further replies.

bclt

Programmer
Mar 13, 2005
363
GR
Hi,

A print an excel sheet and then i want to delete it. How will i know when the printing is over?

'print excel sheet
file.delete("c:\sheet1.xls")

If i write as above an error occurs because the sheet1 is still in use (being printed). So:

While not (sheet1.HasFinishedPrinting)
' nothing here as code, just looping
wend
file.delete("c:\sheet1.xls")



Tnx
 
perhaps you should be better of asking this in the vba forum. Perhaps you already did.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
vba?
The app i am creating is in VB.NET2003 .
 
Arent you using an escell object then? if you are then you need vba to solve it. Or you could use VBA to solve it. Since you are working with the excell namespace witch is what vba uses. And therefore exactly the same thing.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Agree, but why that forum isn't correct for my post?
 
show me the code you have for printing the sheet.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
If you are using a macro/vba script, then the VBA forum would be the correct place.

If you are using a COM excell object, then this would be the place.

I'm not sure about excell but on the Word doc COM object there is a .PrintOut method that takes a boolean parameter that indicates if it should print synchronously, or asynchronously. (True means wait until printing is complete to move on, false means move on immediately.)

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
ah yes, some people still use com. How stupid.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
The question now becomes, is it stupid to use COM, or stupid to assume that no one uses COM? ;P

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Ah, yes. How stupid.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Sorry for posting late. I (the stupid) am using COM component... Microsoft.Intercop.Excel.dll

I am Doing: ExcelApp.Sheets.PrintOut() 'in vb 2005
excelapp.quit

 
As I said in my first post:
Code:
ExcelApp.Sheets.PrintOut(True)
excelapp.quit

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top