LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help in VBA programming

Hi ,
I am facing a major problem for my task.In this task
what we do is, export the comments entered in a word
document to an excel sheet.
The problem is as follows:

Before exporting the Word Comments to an excel sheet,it
has to check for the builtindocument properties,so that
only excel sheets with the particular title property are
selected.
i tried checking for the builtindocument property
(this is a macro in word which should get the excel sheet
builtindocument property) using the following code:

Private Function IsValidxls(xlBook As Object, Optional
sTemplateID As String) As Boolean

Dim bValid As Boolean
Dim sTemplateID As String

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.ActiveWorkbook
Set xlSheet = ActiveSheet

On Error GoTo ErrorHandler
sTemplateID = xlbook.BuiltinDocumentProperties
("keywords").Value
'// Check whether the selected excel sheet is a valid
template
If sTemplateID = MPP_GIP_TEMPLATE_ID Then
bValid = True
Else
'// This required.
'// Template ID will be retured from the function
when it is not matching
bValid = False
End If

ExitRoutine:
IsValidxls = bValid
Exit Function

ErrorHandler:
bValid = False
Resume ExitRoutine
End Function

when i run my program using this function it give an error
message "Object Variable or With block variable not set"

could anyone help me out regarding this.

Thanks & Regards,
Padmaja
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Programming [email protected] New Users to Excel 2 May 28th 08 08:38 PM
CD Programming nelson Excel Discussion (Misc queries) 0 June 4th 06 04:32 PM
Programming help BB Excel Discussion (Misc queries) 3 December 5th 05 01:09 AM
Programming help Me Excel Programming 13 December 26th 03 08:18 PM
How to add via programming ? Milind Excel Programming 3 September 10th 03 11:57 PM


All times are GMT +1. The time now is 08:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"