Access talking to Excel

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 00:00
Joined
Sep 12, 2006
Messages
16,043
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.
 
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?
 
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

Back
Top Bottom