Click here to Skip to main content
15,892,480 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: vb 2017 : AI : Genetic Programming Pin
bluatigro7-Sep-17 23:26
bluatigro7-Sep-17 23:26 
GeneralRe: vb 2017 : AI : Genetic Programming Pin
Arthur V. Ratz7-Sep-17 23:37
professionalArthur V. Ratz7-Sep-17 23:37 
QuestionImport Outlook calendar entries from Excel with VBscript? Pin
xs13x31-Aug-17 11:03
xs13x31-Aug-17 11:03 
SuggestionRe: Import Outlook calendar entries from Excel with VBscript? Pin
Ralf Meier31-Aug-17 20:47
mveRalf Meier31-Aug-17 20:47 
AnswerRe: Import Outlook calendar entries from Excel with VBscript? Pin
Chris Quinn31-Aug-17 22:20
Chris Quinn31-Aug-17 22:20 
AnswerRe: Import Outlook calendar entries from Excel with VBscript? Pin
Ralf Meier1-Sep-17 0:32
mveRalf Meier1-Sep-17 0:32 
AnswerRe: Import Outlook calendar entries from Excel with VBscript? Pin
Richard Deeming1-Sep-17 2:47
mveRichard Deeming1-Sep-17 2:47 
GeneralRe: Import Outlook calendar entries from Excel with VBscript? Pin
xs13x1-Sep-17 3:13
xs13x1-Sep-17 3:13 
Thanks for all the suggestions. I have made some of the amendments suggested and the code looks like this:

Dim objExcel, objWorkbook
   Dim objOutlook, objNameSpace, objFolder, foundItems, objAppt
   Dim i, j, strFilter

   Const olFolderCalendar = 9

   Set objExcel = CreateObject("Excel.Application")
   objExcel.Application.DisplayAlerts = False
   Set objWorkbook = objExcel.Workbooks.Open("C:\VBATest\Dates.xlsx")
   objExcel.Application.Visible = False
   'objExcel.ActiveWorkbook.Save'
   Set objOutlook = CreateObject("Outlook.Application")
   Set objNameSpace = objOutlook.GetNameSpace("MAPI")
   Set objFolder = objNameSpace.GetDefaultFolder(olFolderCalendar)

   For i = 1 To 3
       j = 1
       While j > 0
           strFilter = "[Start] >= '" & objWorkbook.Worksheets(i).Cells(4,2) & "' AND [Start] <= '" & objWorkbook.Worksheets(i).Cells(4,3) & "' AND [Subject] = '" & objWorkbook.Worksheets(i).Cells(6,j) & "'"
           Set foundItems = objFolder.Items.Restrict(strFilter)
           Set foundItems = objFolder.Items.Restrict(strFilter)
           If foundItems.Count = 1 Then foundItems.Item.Delete
           Set objAppt = objFolder.Items.Add
           With objAppt
               .Subject = objWorkbook.Worksheets(i).Cells(6,j)
               .Body = objWorkbook.Worksheets(i).Cells(6,j)
               .Start = objWorkbook.Worksheets(i).Cells(7,j)
               .AllDayEvent = True
               .ReminderMinutesBeforeStart = 1440
               .Save
           End With
           Set j = j + 1
           If objWorkbook.Worksheets(i).Cells(6, j) = "stop" Then Set j = 0
           If objWorkbook.Worksheets(i).Cells(6, j) = "stop" Then j = 0
       Wend
   Next
   objWorkbook.Close False
   Set objExcel = Nothing
   Set objWorkbook = Nothing
   Set objOutlook = Nothing
   Set objNameSpace = Nothing
   Set objFolder = Nothing
   Set objAppt = Nothing


I now get the error Line 20 Error: Condition is not valid.

Any ideas?
GeneralRe: Import Outlook calendar entries from Excel with VBscript? Pin
Richard Deeming1-Sep-17 4:00
mveRichard Deeming1-Sep-17 4:00 
QuestionI need to load a JP2 into an ImageList. All info I've found is out of date. Pin
Member 1338764431-Aug-17 5:19
Member 1338764431-Aug-17 5:19 
QuestionMessage Removed Pin
30-Aug-17 17:49
compcanada201730-Aug-17 17:49 
QuestionOpenFileDialog - Specific Path Pin
purushotham.k929-Aug-17 6:00
purushotham.k929-Aug-17 6:00 
AnswerRe: OpenFileDialog - Specific Path Pin
A_Griffin29-Aug-17 8:07
A_Griffin29-Aug-17 8:07 
QuestionUsing Webclient.uploadfile files is never copied to website Pin
Member 1098357222-Aug-17 12:47
Member 1098357222-Aug-17 12:47 
Questionvb.net desktop app zoom feature Pin
dcof22-Aug-17 6:34
dcof22-Aug-17 6:34 
AnswerRe: vb.net desktop app zoom feature Pin
Eddy Vluggen22-Aug-17 8:15
professionalEddy Vluggen22-Aug-17 8:15 
GeneralRe: vb.net desktop app zoom feature Pin
dcof23-Aug-17 8:49
dcof23-Aug-17 8:49 
GeneralRe: vb.net desktop app zoom feature Pin
Eddy Vluggen23-Aug-17 9:57
professionalEddy Vluggen23-Aug-17 9:57 
SuggestionRe: vb.net desktop app zoom feature Pin
Richard MacCutchan23-Aug-17 21:17
mveRichard MacCutchan23-Aug-17 21:17 
QuestionHow to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
hmanhha20-Aug-17 22:15
hmanhha20-Aug-17 22:15 
AnswerRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
Richard MacCutchan21-Aug-17 0:39
mveRichard MacCutchan21-Aug-17 0:39 
GeneralRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
hmanhha21-Aug-17 15:49
hmanhha21-Aug-17 15:49 
GeneralRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
Mycroft Holmes21-Aug-17 19:59
professionalMycroft Holmes21-Aug-17 19:59 
QuestionMapWinGIS and Visual Basic Pin
Member 1336786618-Aug-17 15:20
Member 1336786618-Aug-17 15:20 
QuestionTrying to connect to SAP Pin
A_Griffin18-Aug-17 5:15
A_Griffin18-Aug-17 5:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.