15,794,374 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Dave the Golfer (Top 46 by date)
Dave the Golfer
23-Apr-21 4:54am
View
Maciej Los Thanks for your solution. All is now working. Wrote the original program some 4 years ago. Have not used VB.net since then and even then I taught myself using the internet as a hobby since retiring.
Dave the Golfer
10-Jan-20 6:12am
View
Christian
When I checked my colleagues PC I found that he had the DLL loaded. But it was in C:\Windows\assembly directory. Whereas, on my PC it was in another directory; C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\15.0.0.0__71e9bce111e9429c
My first thought was to add the sub-directories to his C:\Windows\assembly but his PC would not allow me to create the sub-directories.
Is there a way in Visual Studio 17 to put the DLL in the bin directory and reference it, so I can add the dll to the equivalent directory in Program Files(X86)?
Dave the Golfer
6-Jan-20 17:53pm
View
Thanks
Dave the Golfer
30-May-19 12:46pm
View
Thanks for that . I have realised that HCID is a variable that is set to the ID so does not require "".
earlier JavaScript sets var HCID = 'PHC'+i;
The element ids are PHC1 PHC2 etc
Dave the Golfer
27-Feb-19 13:40pm
View
Tried these links earlier but could not fathom the syntax. Thanks for the help.
Dave the Golfer
27-Feb-19 13:40pm
View
Thanks the change works
Dave the Golfer
20-Jan-19 13:11pm
View
HCID is defined in the SWITCH loop. In this case it is P1HC.
I have inserted "P1HC" in place of HCID and I get a different error suggesting the data being returned is incorrect.
I have modified the code to
var hc = parseInt(this.responseText);
document.getElementById("P1HC").value = hc;
I now get an error stating ;
away12.php:81 The specified value "NaN" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?
The form element with ID P1HC is of type="number".
Suggest I have two problems.
Added alert(HCID); to code. Result is the alert states Undefined. So yes the HCID is not being set in the Switch loop.
Corrected SWITCH loop forgot to put CASE values in between "". Now have the Second problem to resolve.
Thanks for your help on problem one.
PROBLEM TWO:
Changed code in PHP file from $handicap = $db_field[handicap]; to $handicap = $db_field["handicap"];
Value being correctly transferred.
Dave the Golfer
20-Jan-19 13:06pm
View
Deleted
HCID is defined in the SWITCH loop. In this case it is P1HC.
I have inserted "P1HC" in place of HCID and I get a different error suggesting the data being returned is incorrect.
I have modified the code to
var hc = parseInt(this.responseText);
document.getElementById("P1HC").value = hc;
I now get an error stating ;
away12.php:81 The specified value "NaN" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?
The form element with ID P1HC is of type="number".
Dave the Golfer
20-Jan-19 10:35am
View
I do not only want to display the text but I must be able to read it again later when the checkbox is checked so I can update the data tables. If I simply put text in the cell how do I read it again to update the data tables?
Dave the Golfer
30-Nov-18 14:59pm
View
Noticed that the validation is undertaken when the form is submitted.
But can it be done when the data is entered?
Dave the Golfer
13-Feb-18 5:33am
View
Thank you. Worked perfectly.
Dave the Golfer
5-May-17 16:06pm
View
Looking further at the problem I changed my display resolution to same as my end user (1366x768). With this setting I can only see part of the form , in fact that part that my end user prints on the printer or creates as PDF. Which suggests that the command SCROLLABLE does not seem to work on his laptop.
Dave the Golfer
5-May-17 15:55pm
View
Do not understand!
Dave the Golfer
5-May-17 12:29pm
View
Unfortunately the setting of page size did not solve the problem. I thought that the Print to PDF worked but that proved to be incorrect as the PDF Print was the same as printing directly to the HP Deskjet 2540.
As it is a problem with both printers I am assuming that the HP printer is not the problem. It must therefore lie within the laptop! No idea where to start looking!!!
Dave the Golfer
5-May-17 12:21pm
View
Unfortunately the setting of page size did not solve the problem. I thought that the Print to PDF worked but that proved to be incorrect as the PDF Print was the same as printing directly to the HP Deskjet 2540.
Need to get in touch with HP somehow, as I am not an HP owner.
Dave the Golfer
24-Apr-17 17:06pm
View
Richard
Thanks I will look into that. I have now added a line of code to define the paper size. Need to test on my colleague's computer which I hope to do in the next day or so.
Dave the Golfer
17-Mar-17 15:24pm
View
Having upgraded to 2017 I have managed to put my old code into a GIT repo. I have created a branch that allows me to progress in a controlled manner. Thanks for all your help I will now close the question.
Dave the Golfer
16-Mar-17 13:53pm
View
Thanks for the references.
I am upgrading to Visual Studio 2017 to use GIT control.
Found this reference https://www.visualstudio.com/en-gb/docs/git/tutorial/creatingrepo which I think should help.
Dave the Golfer
22-Feb-16 17:32pm
View
Richard
Thanks for the advice. All is working OK.
Dave the Golfer
22-Feb-16 12:09pm
View
Maciej Los
I am working with Excel 2000. so as you state ExportAsFixedFormat will not work. I have a Microsoft to PDF virtual printer loaded on the laptop so I will use that.
Thanks for your considerable help.
Dave the Golfer
22-Feb-16 11:27am
View
Maciej Los
I have set all the constants and all seems to be working at this stage.
But and there is always a but.
I want to save the excel sheet as a PDf file.
In early binding my code is
osheet.ExportAsFixedFormat(Excel.xlFixedFormatType.xlTypePDF, Path & "\" & Filename, Excel.XlFixedFormatQuality.xlQualityStandard, True, True, 1, 10, False)
the late binding code I used is
osheet.ExportAsFixedFormat(dbTypePDF, Path & "\" & Filename, dbQualityStandard, True, True, 1, 10, False)
dbTypePDF is a constant as is dbQualityStandard both set to 0 (zero) but it failed.
Error message states Public member 'ExportAsFixedFormat' on type 'Worksheet' not found.
Am I right in thinking 'ExportAsFixedFormat' is a function of the Excel Interop?
Dave the Golfer
22-Feb-16 10:34am
View
Thanks for that . I have been looking for the enumeration values for the excel constants. Now I have them all I shall recode to late binding.
Dave the Golfer
22-Feb-16 8:57am
View
Thanks Maciej Los.
I was going to try late binding but that has produced errors associated with adding pictures to excel sheet and underlining and alignment.
I also have just added Visual Studio to the laptop so I can work on the machine with Excel 2000. I have referenced the project to Excel 9.0 Object Library.
The Class contains the following imports
Imports Microsoft.Office.Core
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel
but I get Excel.Application etc declared as not defined. Do not know what to import for Excel 9.0 Object Library.
Dave the Golfer
21-Feb-16 13:16pm
View
I change the code to
oRng = oSheet.Range("A1", "H1")
oRng.MergeCells = True
oRng = oSheet.Range("A3", "H3")
'oRng.Value = "Medford Competition"
oSheet.Range("A3").Value = "Medford Competition"
oRng.MergeCells = True
It failed with same error message on the last line.
Dave the Golfer
21-Feb-16 12:16pm
View
ppolymorphe
Tried your suggestion but got the same result.
Certainly looks like Excel 2000 is different to Excel 10.
Dave the Golfer
9-Feb-16 13:20pm
View
Thanks very much. Works perfectly. Proper job.
Dave the Golfer
8-Feb-16 10:27am
View
Thanks, I have been scratching my head for sometime now. Works beautifully
Dave the Golfer
29-Jan-16 6:28am
View
Revisited your advice and using Excel seems to be the way forward. Thanks very much. Siddharthrout. Com does very good articles on using Excel in VB .net
Dave the Golfer
20-Jan-16 17:29pm
View
Thanks for your suggestion but I do not wish to use Excel.
Dave the Golfer
19-Jan-16 11:23am
View
Richard
Thanks for the advice. I am shying away from a DataGridView as I wanted to display the data in the format I want it printed rather than in a spreadsheet format.
Dave the Golfer
19-Jan-16 11:21am
View
Maciej
Thanks for the advice. I will look into the ReportViewer package.
Dave the Golfer
12-Jan-16 11:47am
View
See my comments to the other solutions. Thanks for your help.
Dave the Golfer
12-Jan-16 11:46am
View
See my comment for solution 3. Thanks for your help.
Dave the Golfer
12-Jan-16 11:45am
View
Thanks for the advice. Bit of a novice here. As I used earlier code to calculate the value and then display it in a label I do not need to convert it back as the value is already available.
Dave the Golfer
8-Jan-16 16:13pm
View
I decided on CSV rather than XML because each set of data records are the results of a golf competition. There are going to be a lot of competitions and I was concerned that the loading of the xml into a DOM would start to become a slow activity.
I plan to use a csv file for each competition with the file name related to the date of the competition just incase I need to recall the results at a later date.
Dave the Golfer
27-Jul-15 17:26pm
View
Thanks for your help.
Using the debugger I realised the line node.RemoveAll() was not working correctly.
I found a solution on StackOverFlow web site.
I replaced node.RemoveAll() with node.ParentNode.RemoveChild(node).
Code now works.
Dave the Golfer
19-Mar-15 17:26pm
View
It is annoying but the same line of code works in VBA and Excel.
Dave the Golfer
19-Mar-15 17:06pm
View
Whilst debugging I set a breakpoint and used F11 to step through code.
Having got to the errorhandler I moved the arrow back to the start of the subroutine and carried on stepping.
On reaching the line oLapp = CreateObject("Outlook.application") I got the following error;
An unhandled exception of type 'System.Exception' occurred in Microsoft.VisualBasic.dll
Additional information: Cannot create ActiveX component.
Dave the Golfer
19-Mar-15 16:55pm
View
I do not get an error message but when I have run my code I get this output.
'MatchManagement.vshost.exe' (CLR v4.0.30319: MatchManagement.vshost.exe): Loaded 'D:\My Documents on D\Visual Studio Projects\Match Management Application\MatchManagement\bin\Debug\MatchManagement.exe'. Symbols loaded.
'MatchManagement.vshost.exe' (CLR v4.0.30319: MatchManagement.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'. Cannot find or open the PDB file.
'MatchManagement.vshost.exe' (CLR v4.0.30319: MatchManagement.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll'. Cannot find or open the PDB file.
'MatchManagement.vshost.exe' (CLR v4.0.30319: MatchManagement.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
A first chance exception of type 'System.Exception' occurred in Microsoft.VisualBasic.dll
The program '[4464] MatchManagement.vshost.exe' has exited with code -1 (0xffffffff).
Dave the Golfer
17-Mar-15 15:03pm
View
Sorry tried that but it is not there
Dave the Golfer
8-Mar-15 3:28am
View
phil.o
Thanks
I am very new to this. I have added Imports System.Xml above the form class and all works okay.
Again thank you very much
Dave
Dave the Golfer
5-Mar-15 6:48am
View
Gideon
Changed code to
If NewName = 1 Then
MsgBox("Adding Name")
For i = 1 To 16
updateComboName = "Player" & i
updateCombo = CType(Me.Controls(updateComboName), ComboBox)
updateCombo.Items.Add(curComboItem)
Next
End If
It now works, thanks for your support and patience.
Dave
Dave the Golfer
5-Mar-15 6:39am
View
Gideon
Code is now
If NewName = 1 Then
MsgBox("Adding Name")
For i = 1 To 16
updateComboName = "Player" & i
updateCombo = CType(Me.Controls.Find(updateComboName, True), ComboBox)
updateCombo.Items.Add(curComboItem)
Next
End If
But I get this error
Value of type '1-dimensional array of System.Windows.Forms.Control' cannot be converted to 'System.Windows.Forms.ComboBox'.
Dave
Dave the Golfer
3-Mar-15 7:06am
View
Gideon
My code is for a windows form.
I am an absolute beginner so please forgive me if I ask naive questions BUT
where do I put Me.Controls.Find(updateComboName, True)?
Tried various way but kept getting the code error:
Value of type '1-dimensional array of System.Windows.Forms.Control' cannot be converted to 'System.Windows.Forms.ComboBox'.
Dave
Dave the Golfer
2-Mar-15 16:22pm
View
Maciej Los
Thank you I will create a CSV file and save the items to that.
Dave
Dave the Golfer
2-Mar-15 16:20pm
View
Gideon
Tried the solution but got this error
'FindControl' is not declared. It may be inaccessible due to its protection level.
My code is now
If NewName = 1 Then
MsgBox("Adding Name")
For i = 1 To 16
updateComboName = "Player" & i
updateCombo = CType(FindControl(updateComboName), ComboBox)
updateCombo.Items.Add(curComboItem)
Next
End If
Should FindControl be related to the Form?
Dave
Show More