C
cbender
Hi All;
I'm a bit baffled. I have the following code that works fine as long
as I use a template to create the workbook:
Set objXL = New Excel.Application
With objXL
.Visible = True
Set objWkb = objXL.Workbooks.Add
("\\SomeServer\Reporting\test.xlt")
Set objSht = objWkb.Worksheets.Add
objSht.Name = conSHT_NAME
End With
objWkb.SaveAs (pstrWorkbookLoc)
Set rngCurr = Nothing
lngRtnErr = lngCreateTable(objSht)
....(skip into lngCreateTable..see below
Public Function lngCreateTable(objSht As Excel.Worksheet) As Long
Dim rngCurr As Range
Set rngCurr = objSht.Range("A3")
The line above causes a Type Mismatch error unless I use a Template
when creating the Workbook. Can anyone tell me why?
Thanks in advance
Cheryl
I'm a bit baffled. I have the following code that works fine as long
as I use a template to create the workbook:
Set objXL = New Excel.Application
With objXL
.Visible = True
Set objWkb = objXL.Workbooks.Add
("\\SomeServer\Reporting\test.xlt")
Set objSht = objWkb.Worksheets.Add
objSht.Name = conSHT_NAME
End With
objWkb.SaveAs (pstrWorkbookLoc)
Set rngCurr = Nothing
lngRtnErr = lngCreateTable(objSht)
....(skip into lngCreateTable..see below
Public Function lngCreateTable(objSht As Excel.Worksheet) As Long
Dim rngCurr As Range
Set rngCurr = objSht.Range("A3")
The line above causes a Type Mismatch error unless I use a Template
when creating the Workbook. Can anyone tell me why?
Thanks in advance
Cheryl