Not valid use of the New word

Hi,
I have an old script in visual basic 6 which I need to modify.
In the variables declaration I have the following:
Dim test as mscomm
and later I instantiate this variable in the following way:
set test = new mscomm
In the components I have selected the following:
Microsoft comm control 6.0
I must say that it works fine when I have this in an ocx but I would like to debug a piece of code. The error is in the line with the New and the error is: Not valid use of the New word.
Can anybody help me?
Thanks in advance. Regards.

You can't have the "set" in VB.NET.
If you create a new project and copy-paste the old VB6 code into your file it will convert most of the code for you to be compatible with VB.NET.
I think MSComm might be a Shared class. If so you don't need "test = new mscomm"
You can just use "test.CommPort = 2" for example. I'm not sure about this because this is the only example I could find.
https://msdn.microsoft.com/en-us/library/aa259394(v=vs.60).aspx
Dan Randolph -
My Code Samples List

Similar Messages

  • I exported a pages document to word, but was not able to edit the new word document.

    i exported a pages document to word, but was not able to edit the new word document.

    I have a OSX IMAC Version 10.8.5.  I got pages at the same time I purchased this computer.  I use a document to write all my passwords. Seems like when I E-mail myself the document from pages, I have not been able to type in the document, it acts like it is locked. I checked all the "lock" and "unlock" fields, and none of them were locked.  I notice the document says PDF.  How do I correct this?  Seems like I've tried everything.  If you can help, that would be great!

  • This is a new notification coming up with iTunes, why and how do I fix it? The song "Penny Lane" could not be used because the original file could not be found. Would you like to locate it?

    This is a new notification coming up with iTunes, why and how do I fix it?
    The song “Penny Lane” could not be used because the original file could not be found. Would you like to locate it?
    Max

    Hey xxCreepyFiaxx,
    First, I would try the following suggested steps for when you don't see content in iTunes after updating:
    Quit iTunes.
    Download and install the latest version of iTunes.
    Use the Finder (Mac) or Windows Explorer (Windows) to go to the iTunes folder that contains the iTunes library files:
    Mac OS X
    /Users/username/Music/iTunes/
    Microsoft Windows Windows XP and Windows 2000
    \Documents and Settings\username\My Documents\My Music\iTunes\
    Microsoft Windows Windows Vista and Windows 7
    \Users\username\Music\iTunes\
    Drag the iTunes Library file from the above location to the Desktop.
    Open the Previous iTunes Libraries folder in the iTunes folder.
    Locate the file named iTunes Library YYYY-MM-DD where YYYY-MM-DD is the date you upgraded iTunes (Year-Month-Day).
    Drag this file to the iTunes folder (the enclosing folder).
    Rename this file to iTunes Library.
    Open iTunes.
    You should now see your missing content in iTunes.
    via: No content shows up in iTunes after updating
    http://support.apple.com/kb/TS1967
    If that doesn't resolve the issue, then I'd go through the steps in here:
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/TS1408
    Have a good one,
    Delgadoh

  • I have a new hard drive as my old one crashed. Everything seemed to transfer fine except for my entire iTunes library. It shows all of my old songs, but when I click on one it states "the song could not be used as the original file could not be found

    I have a new hard drive as my old one crashed. Everything seemed to transfer fine except for my entire iTunes library. It shows all of my old songs, but when I click on one it states "the song could not be used as the original file could not be found.would you like to locate it".
    Either how do I locate it, and I've tried every trick I know, or how do I restore all of my songs from one of two sources. I have my old hard drive backedup on an external drive which should have all of my songs, and I have most of my songs on my old iPhone 3S which I'm using as a backup iPod.

    The "missing file" error happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, one of its parent folders, or the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place. In the case of a library moved from one system to another there are also potential permissions issues. See Repair security permissions for iTunes for Windows.
    Select a track with an exclamation mark, use Ctrl-I to Get Info, then click No when asked to try to locate the track. (Due to a bug in iTunes 12 you currently have to say No twice!) Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, a folder renamed, or a drive letter has changed, it should be possible to reverse the actions. If the difference between the two paths is an additional Music folder in one path then this is a layout issue. I can explain further if that is the case.
    In some cases iTunes may be able to repair itself if you go through the same steps with Get Info but this time click Locate and browse to the lost track. It may then offer to attempt to automatically fix other broken links.
    If another application like Windows Media Player has moved/renamed the files then the chances are that subtle differences in naming strategies will make it hard to restore the media to the precise path that iTunes is expecting. In such cases, as long as the missing files can be found somewhere, you should be able to use my FindTracks script to reconnect them to iTunes. See this post for an explanation of how it works.
    See also Recover your iTunes library from your iPod or iOS device.
    tt2

  • HT201269 I had an old PowerMac and now i have the MacBook Pro.  I am not use to the new iTunes.  I use to be able to drag music that I had added onto my computer from a CD to my iPhone or iTouch.  How do I do that with the new iTunes?

    I have CDs that I want to import onto my new MacBook Pro to my iPhone.  I am not use to the new iTunes with the Mountain Lion software.  I had an old PowerMac that had the Leopard software and I was able to drag those songs to my iPhone.  I can't find that option.  When I find the song I want to add to my iPhone, I tried dragging it to the top when it shows that my iPhone is connected with iTunes.  Or how do i do this with the Cloud?  I am new to that as well.  Seems like it just held my purchased songs from iTunes.

    iCloud only has content purchased (or free) from iTunes. Ripped music or music from other sources is only on your computer. As the iPhone can only sync with one computer at a time you should copy the iTunes folder from the old computer to the new one. It's in the Music folder on the old one, just copy the entire folder to the Music on the new computer. When you first sync your iPhone content will be replaced by the content of the new computer.
    You can optionally enable iTunes Match. This searches the non-iTunes content in iTunes or on your iPhone and finds the original digital version on the Internet if it exists. This then becomes your backup. If you have music that it cannot find it will upload it to your cloud storage, but you may have to pay for the storage if it is over 5 GB total (along with your backup). iTunes content and Match content are not included in the 5 GB free limit.
    Usually to fix mail issues just delete the account, reset (reboot) the phone by holding HOME and SLEEP until an Apple logo appears, and adding the email account(s) back.

  • Recently bought  a new computer and all my music appears in iTunes as well as on my computer in a saved folder. When I try to play the music in iTunes I get an error that reads"the song could not be used because the original file could not be found."

    Recently bought  a new computer and all my music appears in iTunes as well as on my computer in a saved folder. When I try to play the music in iTunes I get an error that reads"the song could not be used because the original file could not be found. Would you like to locate it?" Hope you can help me solve this issue.
    Thanks,
    Shellyboo

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

  • HT1459 We recently bought a new HP all in one Pavelion computer, and once it was set up we downloaded my itunes.  Now when I go to play a song from my library, an error message comes up saying: the song......could not be used because the file could not be

    Since I have a new computer , I had to download my itunes to the new computer.  Now I cannor listen to anything in my library.  I get the message;: the song...could not be used becaue the original file could not be found.  Would you like to locate it? Then gives me the option to loaacat it or cancel:  Why is this happening??

    you have to file the music file if you dont itunes cant play a file that does not exist. check the get info and look for the old music file on your old computer. Or do this http://support.apple.com/kb/ht4527.

  • I have a new computer that downloaded all of my playlist. but i cannot play all songs. i get a error that say "the song could not be used because the original file could not be found. would you like to locate it? but it does not help to resolve.

    i installed itunes to my new computer and transfered all my playlist from the older computer. the software came with the new computer hp link up. the problem
    comes in where i want to play a certain song on a playlist and this error pops up "the song could not be used because the original file could not be found.
    would you like to locate it? which is of no help.
    is there a solution to this problem?

    The file path for these songs IS NOT correct per your iTunes Library file. 
    See: http://dougscripts.com/itunes/scripts/ss.php?sp=listmias  for an Applescript to locate these files for re-adding.

  • I downloaded the new version of iTunes and now over 100 songs have an exclamation mark beside them and won't play. The message says: "The song ... could not be used because the original file could not be found." How do I get these songs back?

    I downloaded the new version of iTunes and now over 100 songs have an exclamation mark beside them and won't play. The message says: "The song ... could not be used because the original file could not be found." How do I get these songs back?

    Presuming they're on your computer, right click on them and then follow the prompts to locate hte file on your computer.

  • Got a new computer now I'm getting a new error "The song could not be used because the original file could not be found.  Would you like to locate it?"

    So i got a new computer and before i did i backed up al my music onto an external hard drive. I downloaded itunes and went to put my music back on and when I unplug my hard drive i get this message "The song could not be used because the original file could not be found.  Would you like to locate it?". I have close to 3500 songs so its a little annoying that i cant update or sync my ipod/iphone. Are there any tips or tricks you could help me with in order to fix this problem

    Here is the folder hierarchy of my /Home/Music/folder:
    Music folder
    iTunes folder
    iTunes Media folder
    Music folder
    Note that the contents of this last folder in the hierarchy will be different on your computer.

  • TS1702 i am using iphone 2G, i have updated IOS 3.1.3, but i am not able to use whatsapp. the newer version of whatsapp is not working in my phone. please give me the solution.

    i am using iphone 2G, i have updated IOS 3.1.3, but i am not able to use whatsapp. the newer version of whatsapp is not working in my phone. please give me the solution.

    As newer iPhones and iOS versions are made, apps start to drop support for the older versions of the iOS. It looks like you have fallen victim to this. I commend you for sticking with the original iPhone until now, but it looks like it's time for an upgrade if you want to use apps that have dropped support.
    Also the new iPhone provides hundreds of new features and spec upgrades from the original. Check it out! http://www.apple.com/iphone/

  • Recently got a new computer and installed itunes from external drive - all music shows up in the library, however when i click on a song i receive this message "the song could not be used because the original file could not be found".  What do i do?

    I recently got a new computer and installed itunes from which had been saved onto an external drive - all music shows up in the library, however when I click on a song I receive this message "the song "abc" could not be used because the original file could not be found".  What can I do?

    I was given the option to locate the file where the song is held. If so select "locate" and direct it to the folder / file where the song is and open it. itunes then will give you the option to use this process to update all of your library. OK that as this will do it automatically instead of doing them one by one. I hope this helps.
    Martin

  • After downloading itunes on my new computer all of my songs have an exclamation point in front of them and it says the song could not be used because the original file could not be found. How do I fix this?

    After downloading itunes on my new computer all of my songs have an exclamation point in front of them and it says the song could not be used because the orginal file could not be found. How do I fix this?

    Hey waltee911,
    It sounds like you're seeing something similar to this picture:
    If that's the case, the following article has troubleshooting steps to solve the issue:
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/TS1408
    Welcome to Apple Support Communities!
    Sincerely,
    Delgadoh

  • Since i download the new version of i tunes i canot play the songs of my library...it say that "the song could not be used because the original file could not be found" what i do to just play the songs directly? please someone help

    since i download the new version of i tunes i canot play the songs of my library....it say "the song could not be used because the original file could not be found".
    would you like to locate it.i just want to play directly..what i do?  please help  thanks

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

  • Do not use iOS 7. Attempting to install iOS 7 will cause your phone to require a factory reset, thus wiping all your data from the device. Save your data, do not attempt to install the new iOS 7.

    Do not use iOS 7. Attempting to install iOS 7 will cause your phone to require a factory reset, thus wiping all your data from the device. Save your data, do not attempt to install the new iOS 7.

    My phone has been in the Preparaing Iphone for Restore mode for over 2 hrs. I have the following on the itunes page
                Iphone Recovery Mode
              Itunes is restoring the software on this Iphone. 
    I have the Itunes icon and the USB cord display on the iphone home screen
    So I still have 3 hrs to go???  WOW

Maybe you are looking for