Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Need to export file name to users sheet to the next row

I am tryinig to create a print queue. Tom O has helped me with the printing
from the queue, but now I need help putting the file name in the queue (xls
sheet). How do I code to get the fullname of my active book (abc.xls) to be
inserted into the next available row on the users sheet. I've tried piecing
together different code from searching the group, but I'm just causing more
problems.Here is my code so far:

Sub addtoqueue()
Dim usrid As String
Dim AWB As Workbook
Dim uswb As Workbook
Dim printdata_first_empty_row As Long
Dim source_range As Range
Set AWB = ActiveWorkbook
usrid = Environ("Username")
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"G:\Contract QuoteTemplates\2005 quote template\print
queue\" & usrid & ".xls"
printdata_first_empty_row = Worksheets(usrid).Range("A" &
Rows.Count).End(xlUp).Row + 1
With AWB
Destination = AWB.FullName
Application.ScreenUpdating = True
End With
End Sub

thanks for any help given!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need to export file name to users sheet to the next row

How do you decide what workbooks to print?

Are you trying to print the first sheet in every *.xls file in a single
directory?

--
Regards,
Tom Oglvy



"Brad" wrote in message
...
I am tryinig to create a print queue. Tom O has helped me with the

printing
from the queue, but now I need help putting the file name in the queue

(xls
sheet). How do I code to get the fullname of my active book (abc.xls) to

be
inserted into the next available row on the users sheet. I've tried

piecing
together different code from searching the group, but I'm just causing

more
problems.Here is my code so far:

Sub addtoqueue()
Dim usrid As String
Dim AWB As Workbook
Dim uswb As Workbook
Dim printdata_first_empty_row As Long
Dim source_range As Range
Set AWB = ActiveWorkbook
usrid = Environ("Username")
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"G:\Contract QuoteTemplates\2005 quote template\print
queue\" & usrid & ".xls"
printdata_first_empty_row = Worksheets(usrid).Range("A" &
Rows.Count).End(xlUp).Row + 1
With AWB
Destination = AWB.FullName
Application.ScreenUpdating = True
End With
End Sub

thanks for any help given!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Need to export file name to users sheet to the next row

Basically the end user prints out contracts. It is currently setup to ask the
user if they want to print the contract, if they select yes, it prints, if
no, then it just hides the userform. So, what I want to do is when they
select no, they will be given a choice (from a user form) to add this
contract (based on filename) to their queue. Our contracts are created from a
template, so the contracts will always have the "add to queue" macro.

"Tom Ogilvy" wrote:

How do you decide what workbooks to print?

Are you trying to print the first sheet in every *.xls file in a single
directory?

--
Regards,
Tom Oglvy



"Brad" wrote in message
...
I am tryinig to create a print queue. Tom O has helped me with the

printing
from the queue, but now I need help putting the file name in the queue

(xls
sheet). How do I code to get the fullname of my active book (abc.xls) to

be
inserted into the next available row on the users sheet. I've tried

piecing
together different code from searching the group, but I'm just causing

more
problems.Here is my code so far:

Sub addtoqueue()
Dim usrid As String
Dim AWB As Workbook
Dim uswb As Workbook
Dim printdata_first_empty_row As Long
Dim source_range As Range
Set AWB = ActiveWorkbook
usrid = Environ("Username")
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"G:\Contract QuoteTemplates\2005 quote template\print
queue\" & usrid & ".xls"
printdata_first_empty_row = Worksheets(usrid).Range("A" &
Rows.Count).End(xlUp).Row + 1
With AWB
Destination = AWB.FullName
Application.ScreenUpdating = True
End With
End Sub

thanks for any help given!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need to export file name to users sheet to the next row

Sub addtoqueue()
Dim usrid As String
Dim AWB As Workbook
Dim uswb As Workbook
Dim Destination as Range
Set AWB = ActiveWorkbook
usrid = Environ("Username")
Application.ScreenUpdating = False
set uswb = Workbooks.Open( Filename:= _
"G:\Contract QuoteTemplates\2005 quote " & _
"template\print queue\" & usrid & ".xls")
set destination = uswb.Worksheets(usrid).Range("A" & _
Rows.Count).End(xlUp)(2)
Destination = AWB.FullName ' or AWB.Name
uswb.Close SaveChanges:=True
Application.ScreenUpdating = True
End With
End Sub

--
Regards,
Tom Ogilvy



"Brad" wrote in message
...
Basically the end user prints out contracts. It is currently setup to ask

the
user if they want to print the contract, if they select yes, it prints, if
no, then it just hides the userform. So, what I want to do is when they
select no, they will be given a choice (from a user form) to add this
contract (based on filename) to their queue. Our contracts are created

from a
template, so the contracts will always have the "add to queue" macro.

"Tom Ogilvy" wrote:

How do you decide what workbooks to print?

Are you trying to print the first sheet in every *.xls file in a single
directory?

--
Regards,
Tom Oglvy



"Brad" wrote in message
...
I am tryinig to create a print queue. Tom O has helped me with the

printing
from the queue, but now I need help putting the file name in the queue

(xls
sheet). How do I code to get the fullname of my active book (abc.xls)

to
be
inserted into the next available row on the users sheet. I've tried

piecing
together different code from searching the group, but I'm just causing

more
problems.Here is my code so far:

Sub addtoqueue()
Dim usrid As String
Dim AWB As Workbook
Dim uswb As Workbook
Dim printdata_first_empty_row As Long
Dim source_range As Range
Set AWB = ActiveWorkbook
usrid = Environ("Username")
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"G:\Contract QuoteTemplates\2005 quote

template\print
queue\" & usrid & ".xls"
printdata_first_empty_row = Worksheets(usrid).Range("A" &
Rows.Count).End(xlUp).Row + 1
With AWB
Destination = AWB.FullName
Application.ScreenUpdating = True
End With
End Sub

thanks for any help given!






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
sharing excel sheet with multiple users, but other users cant see lana.b Excel Discussion (Misc queries) 3 January 25th 09 11:15 AM
How to disallow a sheet or file from copying by other users JIGNESH MISTRY Excel Discussion (Misc queries) 1 August 27th 08 01:58 PM
How to export all chartobjects in a sheet to powerpoint (creating a new ppt file) as pictures? Gunnar Johansson Charts and Charting in Excel 1 May 9th 05 05:10 AM
Help - Automating a file.. Adding Users , Deleting users, Changing Tim Harding Excel Worksheet Functions 0 March 16th 05 01:25 PM
A macro to export a sheet as UTF8 encoded Unicode file Dario de Judicibus Excel Programming 5 November 21st 03 07:11 AM


All times are GMT +1. The time now is 05:21 PM.

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"