Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 17th, 2006, 06:01 PM
dataman dataman is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 2 dataman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 42 sec
Reputation Power: 0
Newbie requires vba access help please

Hi

I am writing to an Excel spreadsheet from VBA code in access. When I reference the sheet with the sheet name hard coded, it works fine:

set objSheet = objExcel.Sheets("5TH 2004")

However, I want the sheet name to be taken from a form as this will not be the same every time. I have a form field called frmSheet and have tried all sorts of combinations to use that, to no avail, e.g:

set objSheet = objExcel.Sheets("me.frmSheet")

Please can someone help me?

Sue

Reply With Quote
  #2  
Old April 19th, 2006, 08:02 AM
hithere's Avatar
hithere hithere is offline
Learner
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: India
Posts: 450 hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level)hithere User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 12 h 13 m 21 sec
Reputation Power: 18
try using

set objSheet = objExcel.Sheets(me.frmSheet.text)
__________________
Do, or do not. There is no 'try'.

Reply With Quote
  #3  
Old April 19th, 2006, 02:36 PM
dataman dataman is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Posts: 2 dataman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 42 sec
Reputation Power: 0
thank you so much! I spent a long time on that and it was so simple. I just needed to set the focus first and it worked a treat.

Sue

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Newbie requires vba access help please


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT