From: Mike H. on 27 Apr 2010 10:39 I can't seem to get this to work: Dim wb As Workbook Set wb = Workbooks.Open("z:\journal entry.xlsm") Application.Run wb.Name & "!CreateSubmittal" The Sub CreateSubmittal is designated as "Public Sub CreateSubmittal()" or not. The Sub is in the THisWorkbook object or Module1. Neither works. Ideas? Thanks!
From: JLGWhiz on 27 Apr 2010 11:30 Hi Mike, It's all in the Quote marks. Note the Apotrophe enclosed in double quotes on both ends of the file name variable. Application.Run "'" & wb.Name & "'" & "!CreateSubmittal" "Mike H." <MikeH(a)discussions.microsoft.com> wrote in message news:4727B3E3-802E-47EF-A2C8-7032421AE8E9(a)microsoft.com... >I can't seem to get this to work: > Dim wb As Workbook > Set wb = Workbooks.Open("z:\journal entry.xlsm") > Application.Run wb.Name & "!CreateSubmittal" > > The Sub CreateSubmittal is designated as "Public Sub CreateSubmittal()" or > not. > The Sub is in the THisWorkbook object or Module1. Neither works. > > Ideas? Thanks!
|
Pages: 1 Prev: Counting rows and inserting blank lines Next: Wrapping entries in a ListBox |