Visual Basic macro run time error(13) type mismatch

Hi,
I am having trouble to run the following VB macro. It basiclly fills one row 
of sheet with data extracted from Lotus Notes. Looks like VB can only make 
around 10 assignment statements. I have tried to comment out assignment 
statements at various places, the run time error always happened at around 9 
or 10th statements. 

I don't know Excel and VB very much though. I inherited this application 
from someone I don't know. And this application runs fine on my old windows 
2000 machine. But it failed on my newly upgrate windows XP pro machine.

Anyone know what's going on here?

Thanks.

Paul


'---------------------------------------------------------------------------------------------
Option Explicit

Const ID_COLUMN As Integer = 1
Const UNIQUE_ID_COLUMN As Integer = 2
Const NAME_COLUMN As Integer = 3
Const SCF_COLUMN As Integer = 4
Const OWNER_COLUMN As Integer = 5
Const CONNECTED_COLUMN As Integer = 6
Const LEAD_COLUMN As Integer = 7
Const BRANCHWK_COLUMN As Integer = 8
Const TEST_REQUIRED_COLUMN As Integer = 9
Const TEST_PERFORMED_COLUMN As Integer = 10
Const TEST_ENGINEER_COLUMN As Integer = 11
Const PRIORITY_COLUMN As Integer = 12
Const STATUS_COLUMN As Integer = 13
Const RELNAME_COLUMN As Integer = 14
Const RELTIME_COLUMN As Integer = 15
Const LATEST_COLUMN As Integer = 16

Private Declare Function CoRegisterMessageFilter Lib "OLE32.DLL" _
    (ByVal lFilterIn As Long, ByRef lPreviousFilter) As Long
'--------------------------------------------------------------------------------------------
Public Sub GetValues(doc As Object, TargetExcelSheet As Worksheet, ByVal 
counter As Integer)
   Dim var1, var2 As Variant
   Dim Anch As Range, addr As String
   

   With TargetExcelSheet
   
   .Cells(counter, ID_COLUMN).Value = doc.ID
   .Cells(counter, UNIQUE_ID_COLUMN).Value = doc.universalID
   .Cells(counter, NAME_COLUMN).Value = doc.Name
   .Cells(counter, LEAD_COLUMN).Value = doc.FELProduct
   .Cells(counter, OWNER_COLUMN).Value = doc.RespNames_tx
   .Cells(counter, CONNECTED_COLUMN).Value = doc.connectedid
   .Cells(counter, STATUS_COLUMN).Value = doc.FEStatus
   .Cells(counter, BRANCHWK_COLUMN).Value = doc.BranchWK
   .Cells(counter, LATEST_COLUMN).Value = doc.LatestComment
  
   .Cells(counter, TEST_REQUIRED_COLUMN).Value = doc.Required
   .Cells(counter, TEST_PERFORMED_COLUMN).Value = doc.Performed
   .Cells(counter, TEST_ENGINEER_COLUMN).Value = doc.LC2te
   .Cells(counter, TEST_ENGINEER_COLUMN) = GetNormalName(.Cells(counter, 
TEST_ENGINEER_COLUMN))
   
    ' Form SCF+team
    var1 = doc.FECFactory
    var2 = doc.FETeam
    If IsEmpty(var2) Then
       .Cells(counter, SCF_COLUMN).Value = var1(0)
    Else
        .Cells(counter, SCF_COLUMN).Value = var1(0) & " " & var2(0)
    End If

   .Cells(counter, PRIORITY_COLUMN).Value = doc.FePriority
   .Cells(counter, RELNAME_COLUMN).Value = doc.ReleasedName
   If Not IsEmpty((.Cells(counter, RELNAME_COLUMN))) Then
       .Cells(counter, RELTIME_COLUMN).Value = Right(.Cells(counter, 
RELNAME_COLUMN), Len("yyyy_wkww"))
   Else
       .Cells(counter, RELTIME_COLUMN).Value = "No BREL"
   End If
    
    ' create hyperlink to Notes - note! Requires Notes registry fix
    
   Set Anch = .Cells(counter, ID_COLUMN)
   addr = "notes://" & Range("server").Value & "/" & Range("path").Value & 
"/0/" & .Cells(counter, UNIQUE_ID_COLUMN)
   'txt = .Cells(counter, ID_COLUMN).Value

    ' this creates a clickable link into the cell defined, clicking the link 
will open the doc in Notes
   ActiveSheet.Hyperlinks.Add anchor:=Anch, Address:=addr
   
   End With
   
   
   
End Sub


0
10/25/2005 6:28:02 AM
excel.misc 78881 articles. 5 followers. Follow

0 Replies
437 Views

Similar Articles

[PageSpeed] 30

Reply:

Similar Artilces:

Report error Msg.
I have a db that the user is getting the following error Msg. when the user opens a report in preview mode. “The OpenReport action was canceled.” The user is getting this error Msg when he opens every report. When the user sends the DB to me it works fine. Any idea what’s up?? Does this user have a printer defined in the windows system as the default printer? -- Good Luck BS"D "KAnoe" wrote: > I have a db that the user is getting the following error Msg. when the user > opens a report in preview mode. “The OpenReport action was canceled.” The > user is ge...

ActiveSync Error 86000108 and Exchange OMA
I try to synchronize a smartphone (Qtek 9100) running Windows Mobile 5.0 with my Exchange Server 2003 SP2 through the local network (not Over The Air). Everything worked fine during one month, and now I can't synchronize with Exchange any more; I keep on getting ActiveSync Error number 86000108. I am using ActiveSync 4.1 on my Windows XP Pro computer. I also had an error ActiveSync error number 80072efd , once. I checked IIS and Exchange OMA on the server. I restarted the Exchange server completely. Nothing significant in the Event Log of the server. Any idea? Help greatly appreciated...

Rules do not run
Hello, The rules that I've created do not run automatically when I open outlook. They do not run when new mail arrives while Outlook is running (open on desktop). They do run correctly when executed via to Tools->Rules and Alerts->Run Rules Now Any Ideas, Thanks in Advance, Justin ...

MF_GRAYED for menu items (run time)
HI. I would like to enable and able some of my menu items in run time. Here is the code I have been writing, but it seems not to work, as nothing is gonna happen: BEGIN_MESSAGE_MAP(CTestGLApp, CWinApp) //... ON_COMMAND(ID_REMOVE, OnRemoveData) //... END_MESSAGE_MAP() void CTestGLApp::OnRemoveData () { CSelectDlg SelectDlg; SelectDlg.DoModal(); MyGlobDat.erase(MyGlobDat.begin() + SelectDlg.GetIndex()); if(!MyGlobDat.size()) { CWnd *wind; wind = AfxGetMainWnd(); CMenu *menu = wind->GetMenu(); menu->EnableMenuItem(ID_REMOVE,MF_GRAYED); } } Thanks a lot for your help! ...

Calculating Time Difference
Hi, Searched previous postings but can't find an answer to my problem - hope someone can help. I have two columns both in hh:mm format; first shows a start time and second shows a stop time. I want a third column to show the difference in hours and minutes between the two times - if I can't have this I will accept difference in minutes only between the two times. Best I have come up with is the calculation =ABS(a2-a1) and custom format the cell to show minutes only; [mm]. There seems to be a problem with this - the calculation does not always return the expected time differe...

There was an error reading the rules from the server.
I received the following error when opening Outlook 2000: 'There was an error reading the rules from the server. The format of the server rules was not recognized'. I have checked there are no rules set in the rules wizard. The server is running Exchange 2000. I tried outlook.exe /cleanrules but no good. I have searched on the Microsoft site and on here, but can't find any reference to this error. Has anyone ever come across it before? How should I take out any server-side rules from Exchange server itself? I haven't done it before. Thanks! There are a couple of tool...

Error using MOP/POP link
GP v8.0 When attempting to create a purchase order using the MOP/POP link feature, users are occasionally getting a message saying "This transaction is being edited by another user". 1. The user hits "Create PO" from the MOP/POP link screen. 2. The PO Entry screen comes up with a new PO#. 3. User gets message saying "transaction is being edited by another user" You then cannot do anything with the PO, and if you repeat the result is the same. Any ideas? ...

error MIDL2025 : syntax error : expecting { near ","
I get the following error when i try to inherit a interface in a IDL file, error MIDL2025 : syntax error : expecting { near "," inside the IDL file i am trying to use a interface like this, interface IVehicle : ICar, IUnknown { }; Any idea why this error is coming? Thanks ...

HQ CLient Error #2
I have got a runtime error 6 overflow whenever i go into HQ Client configuration, I have uninstalled RMS restarted my PC and then reinstalled RMS and i still get this error this is RMS version 2.0. Please can some one help as i am really struggling with this!!! I have looked and the only runtime 6 post i can find is to do with transfers having a large number but there is nothing i can see in HQ Client that is too long and cannot get into configuration. ...

XmlValidatingReader invalid xsi:type
I have an abstract base class and two derived classes that I want to serialize and deserialize with schema validation. When I serialize instances of the derived classes the XmlSerializer adds the xsi:type="DerivedClass" attribute and the Instance Namespace. When I attempt to validate the xml upon deserialization the XmlValidatingReader chokes on this attribute value. I can't seem to find a way around this. Any suggestions? Could you post your final XSD and XML you are trying to validate using XmlValidatingReader ? "Jason Cartwright" <jason@cartwrightkids.com> w...

Only one user at a time can access OWA
Using Exchange 5.5 SP3 on W2K. Only one user can log on using OWA at any one time. As soon as the first user logs out the next can then log on, but in a organisation of 1300 - bit of a problem. Previously we did have things working fine with Exchange 5.5 on WinNT but a hacking attack put paid to that system! Have run through MS trouble shooting but found no mention of this problem anywhere else. Any suggestions welcomed Regards Mike Cameron cameronm@queensbury.beds.sch.uk (Mike Cameron) wrote: >Using Exchange 5.5 SP3 on W2K. Only one user can log on using OWA at >any one time. As...

Error Message #92
I have a user (User A) that has been granted Publishing Editor permissions for User B's calendar. User A has Win2000 OS with Office 2003. User B is using WinXp and Office 2003. User A can access, read, writed, etc. User B's calendar, but when trying to print the calendar an error message "The messaging interface has returned an unknown error. If the problem persists, restart Outlook," is returned. The user exits out of Outlook and starts again, but the same error message is returned. I have looked at microsoft's web site, but all posts regard earlier versions of Outl...

CRM 1.2 Installation Error 800700B7 unable to Configure Web Services
Hi, I have followed the steps and pre-requisites in the Installation guide, however, every time I have tried to install the productl, I get a message stating "Setup was unable to install CRM Server. Setup was unable to configure the Web Services that are using ASP.NET. Cannot create a file when that file already exists (800700B7). Can somebody please help me with this? I am unable to use the product because of this error, as the installation does not complete all of the necessary steps. Thank you in advance. CM not sure if you are using windows 2000 server or not, but I had a sim...

Getting 'unspecified error' sending email with embedded image?
I'm using an email newsletter template in Word, and including image files. I cut and paste the final word version into Outlook, and send. When I format the images to appear in front of the text, and try to send as an email, I get a message 'unspecified error' and the email won't send. If I format the images behind the text, the email can be sent, but the images do not appear in the received email. Any suggestions? Thanks a lot, Judy ...

Adding times
I am using Excel 97 I have a column that has a list of time in hours and minutes, 34:12 (thirty foru hours and 12 minutes). How can I add these and also do an average. I would like to be be able, forsinstance to add 12:34 plus 23:52 minutes and get 36:26. HELP Also need to average this as well. Linda Linda just add the cells and format the result as Custom [hh]:mm Regards Trevor "Linda" <anonymous@discussions.microsoft.com> wrote in message news:00ff01c3fa5d$0da474d0$a001280a@phx.gbl... > I am using Excel 97 > I have a column that has a list of time in hours a...

Visual Basic
Hi, I trying to create a table using visual basic, when i try to run it. It prompt me "No fields defined, can't append Table or Index. Anyone, could highlight to me what is the problem. My code is as follows: Public Sub PCreateTable() Dim dbs As DAO.Database Dim tdf As DAO.TableDef Dim idx As DAO.Index Dim fldTradeDate As DAO.Field Dim fldStockName As DAO.Field Dim fldRemarks As DAO.Field Dim fldCurrency As DAO.Field Dim fldClose As DAO.Field Dim fldChange As DAO.Field Dim fldVolume As DAO.Field Dim fldHigh As DAO.Field Dim fldLow As DAO.Field Dim fldValue As DAO.Field Dim fldDay...

DTD ?? and Errors when trying to Retrieve / Read a generated XML f
Hi All Hope someone can help. Using WebRequest.Method = "POST" and ContentType = "application/x-www-form-urlencoded" I connect to a web application which then is expected to return me an XML file ie It is generated and returned rather than existing as a file in a location. my webrequest reads as... http://webedu/webct/public/serve_webctdb?OPERATION=homearea_xml From the Browser I get this returned <?xml version="1.0" standalone="no" ?> <!DOCTYPE homearea (View Source for full doctype...)> - <homearea base="http:...

If I press F9 I get error message "operation failed"
If I press F9 to download all messages I get error message "operation failed" but I can download messages from each email account manually using menu bar receive. Is there a remedy? ...

Unexpected error in CRM when sending e-mail
I have a user who wishes to send a draft e-mail created with a webservice. When he tries to send it, it give a message "An error has occured". He was able to send these webservice messages before and has been able to afterward as well. Just THIS e-mail will not send. WHAT/ WHERE do I start. I have looked for Event log messages, but there are none. Is there a way to turn these on or off, because it may not be turned on to get the event log to get these messages??? Any help here would be appreciated. Note: The message does not contain anything that has not been sent before ...

cant send email but can recieve SMTP error
I have looked at other problems but there were many almost the same but not exactly. I can receive. When I send a message it gives me an error.. timed out waiting for SMPT client....check ISP.. I went into tools and checked the connections. Tested the lines and all was ok.. I diabled Norton email check.. I am running a windows XP with microsoft office professional edition.. We are trying to switch over from ACT!.. this is seeming to be frust rating more than helping.. please help.. thanks SMTP client? Does your SMTP server require authentication and is that configured in Outlook? &q...

MSCRM Outlook client error
Installed Outlook client for sales successfully When clicking on CRM home page or CRM shortcuts it is displaying/showing an error "An error occurred while initilizing MSXML. Try installing it again.". Uninstalled and Installed it again but the error is same. Clicking on Go offline button is displaying an error message box " CRM sales for outlook cannot go offline, the logged on user does not have sufficient privilages or Microsoft CRM was not found" Please advise!!! Thanks and regards Bhaskar T Make sure that you are using I.E. 6.0 or have all the updates to 5.0. I...

405 error is because of what?
Hello, I am try to connect web server but if i have all acesses (INTERNET_OPEN_TYPE_DIRECT) then it is ppossible to get and post the data but if I use INTERNET_OPEN_TYPE_PROXY then it is not possible to get the data. i am giving it Proxy name and port like proxy:port, and giving user name and password also but still 405 ect error r comming. Is this comming because method with i am using is wrong or server will send me this because of the Server will not allow this type of GET / POST using PROXY. What are the basic need to acusse Web server unsing WININET <shrikant.gurav11@gmail.co...

error syncing money 2004 with PocketPC
I get the following error when trying to sync my money file with my Ipaq: 2003-12-17 17:07:36 00000B28 - ERROR: Initialization of SSP 'Microsoft Money' failed. Error: 0x80140010. 2003-12-17 17:07:36 00000B28 - ERROR: Unable to start SSP 'Microsoft Money'. Error code: 0x80140010 Does anyone know what this error is. I've uninstalled and reinstalled the Money for PPC software and I get the same error. Two days ago this was working fine. Thanks Which OS on your iPAQ? And which client? -- Michael Gordon MVP "Arthur Thompson" <arthur-thompson@sbcglobal.net&...

ShowAllData works when filtered, error code when all showing?
I have a PRINT ALL macro with button on a sheet. There are 2 other print macros each filtering the data by 2 criteria. The 3rd, however, is to print the entire worksheet without filters and I put the ShowAllData code at the beginning before doing the sort and bringing up the print dialogue box:\ ActiveSheet.ShowAllData Application.Goto Reference:="R1C4" Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("C2") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom ...

Runtime Error 429 ActiveX component can't create object
I just bought a new Dell computer and installed Great Plains and FRX. When I go to launch FRX I get the message "Runtime error 429 ActiveX component can't create object" This message only appears on the new computer. All the other older computers run XP and do not have this error. Any ideas? Have you tried registering the FRx dll files on that machine? What service pack of Windows are you running? "DougK" <DougK@discussions.microsoft.com> wrote in message news:7584BC6F-9B40-42F5-BFC7-CB92DBCEC5E3@microsoft.com... >I just bought a new Dell computer an...