S
SAL
Hello,
I hope this is the right place to post this question. I have a VB6
application that has been using automation to run code in Excel for years
and all of a sudden, it can't find the function in Excel that I'm calling.
I'm posting my code below but it's fairly straightforward. I could use a
little help on it.
sToPath = App.Path & "\Excel\FullProperty.xls"
bSuccess = CopyFile(sFromPath, sToPath)
If bSuccess Then
SetAttr sToPath, vbArchive
End If
Set myXL = GetObject(, "Excel.Application")
If myXL Is Nothing Then
Set myXL = CreateObject("Excel.Application")
End If
Set MyXlSheet = myXL.Workbooks.Open(FileName:=sToPath)
MyXlSheet.Application.Visible = True
DoEvents
ReadyExcel
' The next line produces the Error:
' 1004 The macro 'CopyComps' cannot be found
MyXlSheet.Application.Run "CopyComps", 2, m_XArray.UpperBound(2) -
3
MyXlSheet.Application.Run "FillComps", m_vExcelArray
It could always find it before and I have verified that the routine is
definitely there.
Thoughts? PS, the spreadsheet isn't protected....
SAL
I hope this is the right place to post this question. I have a VB6
application that has been using automation to run code in Excel for years
and all of a sudden, it can't find the function in Excel that I'm calling.
I'm posting my code below but it's fairly straightforward. I could use a
little help on it.
sToPath = App.Path & "\Excel\FullProperty.xls"
bSuccess = CopyFile(sFromPath, sToPath)
If bSuccess Then
SetAttr sToPath, vbArchive
End If
Set myXL = GetObject(, "Excel.Application")
If myXL Is Nothing Then
Set myXL = CreateObject("Excel.Application")
End If
Set MyXlSheet = myXL.Workbooks.Open(FileName:=sToPath)
MyXlSheet.Application.Visible = True
DoEvents
ReadyExcel
' The next line produces the Error:
' 1004 The macro 'CopyComps' cannot be found
MyXlSheet.Application.Run "CopyComps", 2, m_XArray.UpperBound(2) -
3
MyXlSheet.Application.Run "FillComps", m_vExcelArray
It could always find it before and I have verified that the routine is
definitely there.
Thoughts? PS, the spreadsheet isn't protected....
SAL