View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brad Brad is offline
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!