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

 

Yotematoi

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

|iR|Focalor

February 13, 2025, 07:31:24 AM
I was on DM this morning for the first time in a pretty long time. Seemed fine to me.

0rbisson

February 13, 2025, 04:54:21 AM
DM server is fucked. 2 point blank rockets from spawn and lava damage and player survived? WTF?" Also someone has fucked with the spawn points, every single time no matter how big the map you spawn right in front of the person who killed you last
 

rikwad

February 08, 2025, 10:48:18 PM
Seattle FFA now has working HTTP downloads. Thanks Unholy!
 
RIP Pepp   ✟
 
 

-Unh0ly-

February 03, 2025, 01:20:14 AM
vvvALL WEAPS HAVE MUZZLE FLASH vvvv
 

|iR|Focalor

December 25, 2024, 12:15:35 AM
 

|iR|Focalor

December 25, 2024, 12:06:54 AM
 

RailWolf

December 23, 2024, 09:15:50 AM
Fixed the image for you =)
And Die Hard is a great Christmas movie
 

|iR|Focalor

December 19, 2024, 04:55:07 AM
correction - you gotta put the whole word, not just w: {img width=210}

Show 50 latest
Welcome, Guest. Please login or register.
February 18, 2025, 02:35:43 PM

Login with username, password and session length