View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Confused about assigning DIM and such

When you access a workbook via the Workbooks collection, use just
the filename without the directory path. E.g.,

Set QteFile = Workbooks("QuoteNumber.xls")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Rookie_User" wrote in
message
...
I thought that this would be a great process of setting up
everything at
front and declaring then assigning. But when it gets to the g
line and says
it subscript out of range error. Any idea's

a-Sub getnewnum()
b-Dim QteFile As Workbook 'This is the source of all quotes
c-Dim ExlPpsl As Workbook 'This is the downloaded file
d-Dim QteSht As Worksheet 'Previous Number worksheet
e-Dim AllQtes As Worksheet 'QteSrc worksheet
f-Dim Ppsl As Worksheet '2. Proposal Data worksheet
g-Set QteFile = Workbooks("C:\Documents and
Settings\jason.hopson\My
h-Documents\A-dec Projects\ICC\ICC KAIZEN
EVENT\QuoteNumber.xls")
i-Set ExlPpsl = ActiveWorkbook
k-Set QteSht = QteFile.Worksheets("Previous Number") 'This is
currently the
l-same as SrcNumSht
m-Set AllQtes = QteFile.Worksheets("QteSrc")
n-Set Ppsl = ExlPpsl.Worksheets("2. Proposal Data")