Access talking to Excel (1 Viewer)

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 19:57
Joined
Sep 12, 2006
Messages
15,634
A couple of things.

a) how do you address a tab with a space in it, in excel from access vba

I tried
sheetassign = chr(39) & "tab name" & chr(39)
Set exSheet = exBook.Worksheets(sheetassign)

currently, I've taken the space out of the tab name, but I just wondered how it should be done.

b) how do you manage comments attached to an excel cell from access vba? (create/append)


many thanks.
 

GinaWhipp

AWF VIP
Local time
Today, 14:57
Joined
Jun 21, 2011
Messages
5,900
Never had a problem with spaces within the name as long as it's enclosed within the quotes. Are you saying you have a space on either side?
 

JHB

Have been here a while
Local time
Today, 20:57
Joined
Jun 17, 2012
Messages
7,732
I think the Chr(39) cause the problem, try the below:
Code:
sheetassign = "tab name"
 Set exSheet = exBook.Worksheets(sheetassign)
Else if you get an error, show it.
 

Users who are viewing this thread

Top Bottom