I am trying to use an excel myclean function and receiving the error 'myClean' is not declared. It may be inaccessible due to its protection level. C:\Documents and Settings\jcward\My Documents\Visual Studio 2010\Projects\CLSHelpdesk\CLSHelpdesk\Form8.vb 32 33 CLSHelpdesk. I have added the reference to both Microsoft excel 12.0 object library as well as Microsoft excel 5.0 object library. Any help would be greatly appreciated.
Thank you
Excel clean function in vb.net
Page 1 of 18 Replies - 718 Views - Last Post: 02 December 2011 - 12:39 PM
Replies To: Excel clean function in vb.net
#2
Re: Excel clean function in vb.net
Posted 02 December 2011 - 10:21 AM
What's your code look like when you are trying to access the file?
#3
Re: Excel clean function in vb.net
Posted 02 December 2011 - 10:40 AM
I do not understand what file you are talking about? The String comes from access database that comes from Helpdesk ticket system. And need to remove any unprintable text. Just like Clean does in Excel.
#4
Re: Excel clean function in vb.net
Posted 02 December 2011 - 10:50 AM
... okay so is "Form8.vb 32 33 CLSHelpdesk" a file you are creating or one your project is accessing?
#5
Re: Excel clean function in vb.net
Posted 02 December 2011 - 11:02 AM
this error looks to me like your variable "myClean" is not declared. you can however give us a little help and show us the code where you get this error
#6
Re: Excel clean function in vb.net
Posted 02 December 2011 - 12:22 PM
If I'm reading your post right. See if the below will work.
Then the Clean string will be Myclean.
Please let me if you need anymore help.
Dim RegExStr As String = "<[^>]*>" Dim Myclean As String = Regex.Replace([YourSting], RegExStr, "")
Then the Clean string will be Myclean.
Please let me if you need anymore help.
#7
Re: Excel clean function in vb.net
Posted 02 December 2011 - 12:28 PM
lattimer1999, on 02 December 2011 - 12:22 PM, said:
If I'm reading your post right. See if the below will work.
Then the Clean string will be Myclean.
Please let me if you need anymore help.
Dim RegExStr As String = "<[^>]*>" Dim Myclean As String = Regex.Replace([YourSting], RegExStr, "")
Then the Clean string will be Myclean.
Please let me if you need anymore help.
Works great except I also need to remove  .
#8
Re: Excel clean function in vb.net
Posted 02 December 2011 - 12:32 PM
Use the below and it will remove that too.
Replace(Myclean, " ", "")
#9
Re: Excel clean function in vb.net
Posted 02 December 2011 - 12:39 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote







|