Author Topic: Visual Basic and excel  (Read 2368 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:

 

-Unh0ly-

May 22, 2025, 05:45:28 PM
 

Yotematoi

May 17, 2025, 08:33:15 AM
Yo desde el año 2007 me enfermé de Q2, es incurable  
Morir y revivir es costumbre, lástima q el QT estaba bueno
 

ImperiusDamian

May 12, 2025, 01:45:35 AM
Quake II is not 27 years old. I refuse to accept THAT much time has gone by.
 

|iR|Focalor

May 11, 2025, 02:33:39 PM
 

-Unh0ly-

May 03, 2025, 08:02:46 AM
198.179.6.200:30634
 

Yotematoi

May 02, 2025, 10:27:47 AM
Note for Player-4109 "Remember, the Guinness Book of Records does not include cowards who shot at someone by treachery." :D
 

|iR|Focalor

April 02, 2025, 02:47:07 AM
 

Yotematoi

February 14, 2025, 12:41:48 PM
 :-*

Show 50 latest
Welcome, Guest. Please login or register.
May 24, 2025, 10:36:37 PM

Login with username, password and session length