Netrunner
03-27-2003, 10:15 AM
Hello everybody.
I need to be able to print an excel worksheet in my application written using VB6.
In a thread of this forum i found a chunk o code that lets me do that, which is:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, "Print", "c:/test.xls", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
But:
- I need to put an header and footer on the page before and after the excel worksheet
- I need to be able to let the user choose which worksheet he wants to print (choosing from several available in the excel file)
Can anybody help me? :rolleyes:
Thanks in advance :D :D
NeT
I need to be able to print an excel worksheet in my application written using VB6.
In a thread of this forum i found a chunk o code that lets me do that, which is:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, "Print", "c:/test.xls", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
But:
- I need to put an header and footer on the page before and after the excel worksheet
- I need to be able to let the user choose which worksheet he wants to print (choosing from several available in the excel file)
Can anybody help me? :rolleyes:
Thanks in advance :D :D
NeT