I am getting an error when trying to execute the following subroutine
"Runtime Error: 9, Subscript out of range"
its highlighting the first variable declaration. At first I thought it was due to the wrong datatype but changing and playing around with that had no luck.
I also tried both Cells & Range
Public vFolderPath As String
Public vCMFNewPath As String
Public vKBNewPath As String
Public vDPI As Integer
Private Sub SetGlobal()
Dim vGo As String
Dim vTemplateLocation As String
Dim vCMFFilename As String
Dim vKBFilename As String
Dim vDriver As String
Dim vPKG As String
vDPI = Workbooks("tools.xlsm").Sheets("SETTINGS").Range("B2").Value
vFolderPath = Workbooks("tools.xlsm").Sheets("SETTINGS").Range("B3").Value & "\"
Any ideas?
MsgBox Workbooks("tools.xlsm").Name
,MsgBox Workbooks("tools.xlsm").Sheets("SETTINGS").Name
- hopefully that will identify where the problem is. – MattCrum Mar 22 '13 at 12:05End Sub
? For the sake of removing the obvious: you DO have a workbook calledtools.xlsm
open, and that workboko does have a sheet namedSETTINGS
, right? – Sam Mar 22 '13 at 12:58Set wb = Workbooks("tools.xlsm")
and thenSet ws = Workbooks("tools.xlsm").Sheets("Settings")
. – David Zemens Mar 22 '13 at 14:14