Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Need vb application to print first Worksheet in excel files

Hi all and thanks in advance to anyone who helps me.

I have multiple excel workbooks containing 4-5 worksheets each. Each
workbook has a worksheet named "Summary" which summarizes calculations
performed on the other sheets.

I would like to design an application with a "browse" option so that I
select a folder or specific excel file and then click print so that it will
print only the summary page for the file.

This sounds possible...i apologize if i posted this in the wrong spot.

Any help is appreciated.

--
Nadia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Need vb application to print first Worksheet in excel files

Nadia,

The macro below should do what you want.

HTH,
Bernie
MS Excel MVP

Sub PrintSummaryForUserSelectedFiles()
Dim filearray As Variant
Dim i As Integer
filearray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(filearray) Then
For i = LBound(filearray) To UBound(filearray)
Workbooks.Open filearray(i)
Worksheets("Summary").PrintOut
ActiveWorkbook.Close False
Next i
Else:
MsgBox "You clicked cancel"
End If
End Sub



"Nadia" wrote in message
...
Hi all and thanks in advance to anyone who helps me.

I have multiple excel workbooks containing 4-5 worksheets each. Each
workbook has a worksheet named "Summary" which summarizes calculations
performed on the other sheets.

I would like to design an application with a "browse" option so that I
select a folder or specific excel file and then click print so that it

will
print only the summary page for the file.

This sounds possible...i apologize if i posted this in the wrong spot.

Any help is appreciated.

--
Nadia



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Need vb application to print first Worksheet in excel files

Thank you for your earlier post.

Should i create this macro within excel and just run it in there rather than
using vb.net to create an actual .exe application?
--
Nadia


"Bernie Deitrick" wrote:

Nadia,

The macro below should do what you want.

HTH,
Bernie
MS Excel MVP

Sub PrintSummaryForUserSelectedFiles()
Dim filearray As Variant
Dim i As Integer
filearray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(filearray) Then
For i = LBound(filearray) To UBound(filearray)
Workbooks.Open filearray(i)
Worksheets("Summary").PrintOut
ActiveWorkbook.Close False
Next i
Else:
MsgBox "You clicked cancel"
End If
End Sub



"Nadia" wrote in message
...
Hi all and thanks in advance to anyone who helps me.

I have multiple excel workbooks containing 4-5 worksheets each. Each
workbook has a worksheet named "Summary" which summarizes calculations
performed on the other sheets.

I would like to design an application with a "browse" option so that I
select a folder or specific excel file and then click print so that it

will
print only the summary page for the file.

This sounds possible...i apologize if i posted this in the wrong spot.

Any help is appreciated.

--
Nadia




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Need vb application to print first Worksheet in excel files

Nadia,

Generally, since Excel will be used to open the workbooks anyway, it doesn't
really matter that much performance wise. If you put the code into a module
in a new workbook, then it will work fine. In vb.net, you would need to
change the code to use the Excel application object that you would start up
when the code started. I would go with the workbook approach, personally.

HTH,
Bernie
MS Excel MVP


"Nadia" wrote in message
...
Thank you for your earlier post.

Should i create this macro within excel and just run it in there rather

than
using vb.net to create an actual .exe application?
--
Nadia


"Bernie Deitrick" wrote:

Nadia,

The macro below should do what you want.

HTH,
Bernie
MS Excel MVP

Sub PrintSummaryForUserSelectedFiles()
Dim filearray As Variant
Dim i As Integer
filearray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(filearray) Then
For i = LBound(filearray) To UBound(filearray)
Workbooks.Open filearray(i)
Worksheets("Summary").PrintOut
ActiveWorkbook.Close False
Next i
Else:
MsgBox "You clicked cancel"
End If
End Sub



"Nadia" wrote in message
...
Hi all and thanks in advance to anyone who helps me.

I have multiple excel workbooks containing 4-5 worksheets each. Each
workbook has a worksheet named "Summary" which summarizes calculations
performed on the other sheets.

I would like to design an application with a "browse" option so that I
select a folder or specific excel file and then click print so that it

will
print only the summary page for the file.

This sounds possible...i apologize if i posted this in the wrong spot.

Any help is appreciated.

--
Nadia






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
Importing data from an application to an Excel worksheet Wally3178 Excel Discussion (Misc queries) 1 January 11th 08 01:18 PM
Excel Files won't open unless from within Excel Application [email protected] Excel Discussion (Misc queries) 1 December 5th 06 09:37 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM
Excel files wont print. Almonte Charts and Charting in Excel 1 August 23rd 05 05:12 AM


All times are GMT +1. The time now is 05:54 AM.

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

About Us

"It's about Microsoft Excel"