LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 145
Default Help with my coding problem?

I'm hoping that someone can help me figure out a coding problem that I
SCREWED UP. I had this code in my Microsoft Word VB Editor that you see
below. The code worked PERFECTLY until I stupidly tried to edit it without
first making a backup. I know, first rule of any work is to make a backup, so
I can't believe I forgot to do that.

As an FYI, the "code" contained below was interfacing with one of my Excel
Workbooks, and allowed me to chose a client name from a dropdown menu (in
Excel), and when the name was chosen, Excel would call up a "Word", and the
Userform that was created would also open. This would then allow me to input
narrative comments into the Userform.

As a result of my "editing", I can select a client name (on the Excel
Workbook), but "Word" and "The Userform" no longer opens (actually it looks
as if it is trying to open, but cannot).

If some kind and knowledge person could look at the code below and let me
know if you see anything that I am leaving out I'd greatly appreciate it.
I've also emailed a few friends for suggestions, but wanted to post here as
well in order to attempt a "resolve" as soon as possible. I so depend upon
computer programs to do their job, so when they don't (thanks to my errors) I
am quite frustrated.

Dan

The Code in the MS Word "Sample Note.doc" VB Editor Module is as follows:

Sub UpdateComments(parm1)

On Error Resume Next

Documents.Open FileName:=parm1

If Not FileExists(parm1) Then ' Check if file/folder exists .....
MsgBox "File " & parm1 & " does not exist", vbOKCancel
Exit Sub
End If

UserForm1.Show vbModeless

End Sub
__________________________________________________ ___________________
Function FileExists(fname) As Boolean
' Returns TRUE if the file exists
Dim x As String
x = Dir(fname)
If x < "" Then FileExists = True _
Else FileExists = False
End Function

 
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
How to fix the coding? Eric Excel Worksheet Functions 4 June 20th 07 02:42 PM
coding maisy1 Excel Discussion (Misc queries) 1 August 6th 06 08:58 PM
Coding metaltecks Excel Discussion (Misc queries) 1 April 17th 06 10:12 PM
First attempt at VBA coding problem Rick in NS New Users to Excel 9 January 12th 06 05:11 PM
coding Hardy Excel Discussion (Misc queries) 1 February 22nd 05 04:58 PM


All times are GMT +1. The time now is 02:32 AM.

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

About Us

"It's about Microsoft Excel"