|
-
Nov 23rd, 2000, 04:30 PM
#1
Thread Starter
Addicted Member
I'm having trouble hiding the dialog box that excel displays when printing something.
I can disable every other dialog by setting the displayalerts property to false, but this only affects dialogs that require input from the user.
The dialog i am talking about is the one that says
Now Printing Page # of #
on the Printer Name
And has a cancel button
I am accessing Excel from my VB program and it is not visible but this little box flashes up all the time when I print.
Does anyone have any ideas on how to hide it?
Regards
Matt Brown
Hamilton, NZ
VB6 C++ in Visual Studio 6sp4
VB.net Beta 1
-
Nov 24th, 2000, 01:26 AM
#2
Addicted Member
Hi mattbrown !!!
As far as I know you can't hide the window. After a researching in "deja" I found out that the only possible solution is that uou can find the window handle and destroy them. But initial the window appears.
Sorry for no better solution.
-cu TheOnly
-
Nov 24th, 2000, 02:10 AM
#3
Thread Starter
Addicted Member
Thats what i had feared
what a bloody pain the customer is complaining about it flashing up all the time
got any ideas on possible workarounds?
Regards
Matt Brown
Hamilton, NZ
VB6 C++ in Visual Studio 6sp4
VB.net Beta 1
-
Sep 30th, 2001, 12:33 PM
#4
Hyperactive Member
I get the following message
I am using this code, below and it works a treat. My only problem
is that after every thing has finished printing I get the Excel message box asking do I want to save the Excel file, Yes/No.
Have you any idea how to stop Excel asking thais question?,I do not want the user to have to do this everytime they print.
Private Sub cmdClick_Click()
On Error Resume Next
Set objExcel = GetObject(",Excel.Application")
If Err.Number <> 0 Then
Set objExcel = CreateObject("Excel.Application")
End If
Err.Clear
On Error GoTo 0
objExcel.Visible = False
'objExcel.Workbooks.Open filename:="C:\Psp\define.xls"
'objExcel.Visible = True
'objExcel.WindowState = xlNormal
objExcel.Workbooks.Open filename:="C:\Psp\define.xls"
objExcel.Cells(22, 8).Value = txtStan(54).Text
objExcel.Cells(1, 1).Value = txtStan(50).Text
objExcel.Cells(2, 1).Value = txtStan(52).Text
objExcel.Cells(3, 1).Value = txtStan(51).Text
objExcel.Cells(4, 1).Value = txtStan(53).Text
objExcel.Cells(5, 1).Value = txtStan(55).Text
objExcel.Cells(6, 1).Value = txtStan(56).Text
objExcel.Cells(7, 1).Value = txtStan(57).Text
objExcel.Cells(8, 1).Value = txtStan(58).Text
objExcel.ActiveWorkbook.PrintOut
objExcel.Quit
End Sub
Thanks
kia kaha kia maia - give of your best, be confident in your own ability
-
Sep 30th, 2001, 12:40 PM
#5
Fanatic Member
try closing each book individualy and telling it whether or not to save changes
VB Code:
Dim book As Excel.Workbook
For Each book In objExcel.Workbooks
book.Close False 'or true if you want to save changes
Next book
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|