All
I have a MS Access application which creates an Excel-file.
From MS-Access I need to put Excel cell comments, but I can't find the right code. I started with an Excel macro and tried to rewrite it into my Access-code.
The recorded macro code in Excel is
In MS-Access I've tried several things like
and
But all of this fails with error: Invalid procedure or argument.
Anyone an idea?
Regads
Ino
I have a MS Access application which creates an Excel-file.
From MS-Access I need to put Excel cell comments, but I can't find the right code. I started with an Excel macro and tried to rewrite it into my Access-code.
The recorded macro code in Excel is
Code:
Range("B10").AddComment
Range("B10").Comment.Text Text:= _
"Description:" & Chr(10) & "test" & Chr(10) & "" & Chr(10) & "case"
In MS-Access I've tried several things like
Code:
dim objExcel, objBook, objSheet, oSheet as object
set objExcel=CreateObject("Excel.application")
set objBook=objExcel.Workbooks.Add(1)
set objSheet=objBook.Sheets(1)
set oSheet=objBook.Worksheets("Sheet1")
oSheet.Range("B10").addcomment Text:="Description:" & Chr(10) & "test" & Chr(10) & "" & Chr(10) & "case"
and
Code:
dim objExcel, objBook, objSheet, oSheet as object
set objExcel=CreateObject("Excel.application")
set objBook=objExcel.Workbooks.Add(1)
set objSheet=objBook.Sheets(1)
set oSheet=objBook.Worksheets("Sheet1")
oSheet.Range("B10").addcomment.comment Text:="Description:" & Chr(10) & "test" & Chr(10) & "" & Chr(10) & "case"
But all of this fails with error: Invalid procedure or argument.
Anyone an idea?
Regads
Ino