Author Topic: Visual Basic and excel  (Read 2215 times)

Offline Moving Shadow

  • Full Member
  • ***
  • Posts: 212
    • View Profile
    • http://www.gyreband.com
  • Rated:
Visual Basic and excel
« on: December 26, 2007, 08:34:40 AM »
Anyone here a VBA/excel whiz?

I am trying to pull a date from a cell in an excel worksheet and make it as a task item in Outlook.    Every time I run this  VBA macro in excel, the date pulled into the tasks list will default to Fri 12/29/1899.  Can any one shed some light one this?  :help:

Below is the code:

Sub Create_Task()

Dim olApp As Outlook.Application
Dim olTask As Outlook.TaskItem

Set olApp = New Outlook.Application
Set olTask = olApp.CreateItem(3)

Application.ScreenUpdating = False

With olTask
.Subject = "Do this Now"
.Body = "You need to do this"
.StartDate = Range("A2").Select
.DueDate = Range("B2").Select
.Status = olTaskWaiting
.Importance = olImportanceHigh
.ReminderPlaySound = True
.Companies = "Your Moml"
.Save
End With

Set olTask = Nothing

Set olApp = Nothing

Application.ScreenUpdating = True

MsgBox "The task-list updated successfully.", vbInformation

End Sub


  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]RottenRose

  • Full Member
  • ***
  • Posts: 239
    • View Profile
  • Rated:
Re: Visual Basic and excel
« Reply #1 on: December 26, 2007, 11:35:55 AM »
I'm not a wiz and I feel pitty on anyone that is when it comes to vb. Could you may be add some notes so others and I can try to understand what you're trying to do with your code. I can read your code, but I don't totally know what you're trying to do with it. You might want to check and see if you skipped a step or mispelled something, vb will chew you up I know if you do something like that.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Ways to love Tastyspleen.tv

Radio: http://bit.ly/1vbPDQ
Video: http://bit.ly/d1htz Movie: http://bit.ly/axvufM facebook:http://on.fb.me/96nVXz Twitter: http://bit.ly/h3zyaP

Offline Moving Shadow

  • Full Member
  • ***
  • Posts: 212
    • View Profile
    • http://www.gyreband.com
  • Rated:
Re: Visual Basic and excel
« Reply #2 on: December 26, 2007, 12:06:58 PM »
I got figured out.

.StartDate = Range("A2").Select should have been .StartDate = Range("A2").Value

weehaw.  Thanks anyways Rose!

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline peewee_RotA

  • Brobdingnagian Member
  • ***
  • Posts: 4152
  • Hi, I'm from the gov'ment and I'm here to help you
    • View Profile
  • Rated:
Re: Visual Basic and excel
« Reply #3 on: December 26, 2007, 03:10:32 PM »
VBA in excel is like sugar in a gas tank. Especially since porting ANYTHING in excel written in VBA requires lowering the standard "security" settings, the installation of a valid certificate, and the constant reminder that you're running scripts. And not the least of which is the fact that VBA scripts cannot run in Excel Viewer, which would be their only real function.


For example if I have a spread sheet listing part numbers and their OEM part numbers and create a script to help sort them. I cannot distribute this script without purchasing a new and most recent copy of Excel for every computer I want to view this on.

I could ramble for hours. Basically VBA is great for Outlook but a waste for everything else.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
 Tune in to the Tastycast!!!!  http://dna.zeliepa.net

Offline Moving Shadow

  • Full Member
  • ***
  • Posts: 212
    • View Profile
    • http://www.gyreband.com
  • Rated:
Re: Visual Basic and excel
« Reply #4 on: December 27, 2007, 10:01:52 AM »
ok this may be a simplier question. I'd like to take the code that I have above, and use it for different tasks.  Is there anyway to do that?  Right now, it will only import 1 startdate and one due date... I'd like to do more.

Any suggestions?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline jägermonsta

  • Brobdingnagian Member
  • ***
  • Posts: 4441
  • Bigger Than Jesus
    • View Profile
  • Rated:
Re: Visual Basic and excel
« Reply #5 on: December 31, 2007, 07:47:22 AM »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

 

El Box de Shoutamente

Last 10 Shouts:

 

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
 

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM
 

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 25, 2024, 11:07:34 PM

Login with username, password and session length