home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_1_1994.iso / 00057 / s / clikbook.xl$ / CLIKBOOK.XLA (.txt)
Excel Spreadsheet  |  1993-07-01  |  21KB  |  508 lines

  1. Sheet: 
  2. (0, 0)        
  3. (0, 1)        ClickBook/Excel Interface
  4. (0, 2)        
  5. (1, 0)        7/1/93
  6. (1, 1)        Change to manual recalc at start, and back again at end.  This doesn't handle
  7. (1, 2)        KNG
  8. (1, 4)        mnu.ClickBook
  9. (1, 5)        -
  10. (2, 0)        
  11. (2, 1)        the ONE LAST recalc you get when you switch back to auto-recalc mode,
  12. (2, 2)        
  13. (2, 5)        Print a Clic&kbook
  14. (2, 6)        PrintClickBook
  15. (2, 8)        Print document using ClickBook
  16. (3, 0)        
  17. (3, 1)        but I don't see a workaround.  Other add-ins do it too.
  18. (3, 2)        
  19. (4, 0)        
  20. (4, 1)        
  21. (4, 2)        
  22. (5, 0)        5/24/93
  23. (5, 1)        Modified from original. 
  24. (5, 2)        KNG
  25. (6, 0)        
  26. (6, 1)        Improved error handling.  Added support for multiple versions of
  27. (6, 2)        
  28. (7, 0)        
  29. (7, 1)        driver attached to various printer ports.  We now match the one currently in use
  30. (7, 2)        
  31. (8, 0)        
  32. (8, 1)        in the default setting.
  33. (8, 2)        
  34. (9, 0)        
  35. (9, 1)        
  36. (9, 2)        
  37. (10, 0)        
  38. (10, 1)        
  39. (10, 2)        
  40. (12, 1)        Global Variables (actually they're ALL global, but...)
  41. (13, 0)        cb.Unassigned
  42. (13, 1)        (Unassigned)
  43. (14, 0)        cb.ErrorNumber
  44. (14, 1)        0
  45. (15, 0)        cb.HWND_BROADCAST
  46. (15, 1)        -1
  47. (16, 0)        cb.WM_WININICHANGE
  48. (16, 1)        26
  49. (18, 0)        cb.Title
  50. (18, 1)        ClickBook
  51. (19, 0)        cb.UnableToRun
  52. (19, 1)        Unable to run ClickBook!
  53. (20, 0)        cb.FirstFinalError
  54. (20, 1)        6
  55. (21, 0)        cb.CRLF
  56. (21, 1)        
  57.  
  58. (23, 0)        cb.Error1
  59. (23, 1)        No device setting was found in Win.INI
  60. (24, 0)        cb.Error2
  61. (24, 1)        Invalid format for device string.
  62. (25, 0)        cb.Error3
  63. (25, 1)        ClickBook was unable to find matching CB driver.
  64. (26, 0)        cb.Error4
  65. (26, 1)        ClickBook was unable to set the printer to the ClickBook driver.
  66. (27, 0)        cb.Error5
  67. (27, 1)        ClickBook was unable to reset the current device in Win.INI.  You may need to use the Windows Control Panel to reset your default printer.
  68. (28, 0)        cb.Error6
  69. (28, 1)        ClickBook found an invalid setting in your Win.INI file.  Please check that file and then retry.
  70. (30, 0)        
  71. (30, 1)        Auto_Open
  72. (30, 2)        Add ClickBook menu item to File menu.
  73. (31, 0)        
  74. (31, 1)        FALSE
  75. (31, 2)        
  76. (32, 0)        
  77. (32, 1)        FALSE
  78. (32, 2)        
  79. (33, 0)        
  80. (33, 1)        TRUE
  81. (33, 2)        
  82. (34, 0)        
  83. (34, 1)        TRUE
  84. (34, 2)        
  85. (36, 0)        
  86. (36, 1)        GetCurrentPrinter
  87. (36, 2)        Get the current printer from Win.INI
  88. (37, 0)        gcp.GetProfileString
  89. (37, 1)        1388904448
  90. (37, 2)        Register the API call.
  91. (38, 0)        
  92. (38, 1)        TRUE
  93. (38, 2)        Assume no errors.
  94. (39, 0)        gcp.printerName
  95. (39, 1)        CB HP LaserJet III,ClikBook,LPT2
  96. (39, 2)        Ask WIN.INI for the current default printer
  97. (40, 0)        
  98. (40, 1)        TRUE
  99. (40, 2)        Unregister our API call to be polite.
  100. (41, 0)        
  101. (41, 1)        TRUE
  102. (41, 2)        
  103. (42, 0)        
  104. (42, 1)        FALSE
  105. (42, 2)        
  106. (43, 0)        
  107. (43, 1)        FALSE
  108. (43, 2)        
  109. (44, 0)        
  110. (44, 1)        TRUE
  111. (44, 2)        
  112. (46, 0)        
  113. (46, 1)        SetCurrentPrinter
  114. (46, 2)        
  115. (47, 0)        
  116. (47, 1)        TRUE
  117. (47, 2)        Printer name to set.
  118. (48, 0)        
  119. (48, 1)        TRUE
  120. (48, 2)        Error to return if this fails.
  121. (49, 0)        
  122. (49, 1)        TRUE
  123. (49, 2)        Assume no errors.
  124. (50, 0)        scp.WriteProfileString
  125. (50, 1)        1989214208
  126. (50, 2)        Register the API call.
  127. (51, 0)        
  128. (51, 1)        TRUE
  129. (51, 2)        Ask WIN.INI to set the new current printer.
  130. (52, 0)        
  131. (52, 1)        TRUE
  132. (52, 2)        Unregister our API call to be polite.
  133. (53, 0)        
  134. (53, 1)        TRUE
  135. (53, 2)        I don't think this will ever fail, but if it does,
  136. (54, 0)        
  137. (54, 1)        TRUE
  138. (54, 2)              set the error number.
  139. (55, 0)        
  140. (55, 1)        TRUE
  141. (55, 2)        
  142. (56, 0)        
  143. (56, 1)        TRUE
  144. (56, 2)        Clear out the names from the name space,
  145. (57, 0)        
  146. (57, 1)        TRUE
  147. (57, 2)        just to save a little memory.
  148. (58, 0)        
  149. (58, 1)        TRUE
  150. (58, 2)        
  151. (59, 0)        
  152. (59, 1)        TRUE
  153. (59, 2)        
  154. (59, 3)        i
  155. (60, 1)         
  156. (60, 3)        TRUE
  157. (61, 0)        
  158. (61, 1)        BroadcastWININIChange
  159. (61, 2)        Tell the world that WIN.INI has changed.
  160. (62, 0)        bwc.SendMessage
  161. (62, 1)        -853475326
  162. (62, 2)        
  163. (63, 0)        
  164. (63, 1)        0
  165. (63, 2)        
  166. (64, 0)        
  167. (64, 1)        FALSE
  168. (64, 2)        
  169. (65, 0)        
  170. (65, 1)        TRUE
  171. (65, 2)        
  172. (67, 0)        
  173. (67, 1)        ExtractString
  174. (67, 2)        Pull out the first part of the device name.
  175. (68, 0)        
  176. (68, 1)        TRUE
  177. (68, 2)        String to extract from
  178. (69, 0)        
  179. (69, 1)        TRUE
  180. (69, 2)        Which comma-delimited piece to extract?
  181. (70, 0)        
  182. (70, 1)        TRUE
  183. (70, 2)        We return a STRING!
  184. (71, 0)        es.Retval
  185. (71, 1)        ClikBook
  186. (71, 2)        
  187. (72, 0)        
  188. (72, 1)        TRUE
  189. (72, 2)        Assume no errors.
  190. (73, 0)        
  191. (73, 1)        TRUE
  192. (73, 2)        
  193. (74, 0)        
  194. (74, 1)        TRUE
  195. (74, 2)        
  196. (75, 0)        
  197. (75, 1)        TRUE
  198. (75, 2)        
  199. (76, 0)        
  200. (76, 1)        TRUE
  201. (76, 2)        
  202. (77, 0)        
  203. (77, 1)        TRUE
  204. (77, 2)        
  205. (78, 0)        
  206. (78, 1)        TRUE
  207. (78, 2)        
  208. (79, 0)        
  209. (79, 1)        TRUE
  210. (79, 2)        
  211. (80, 0)        
  212. (80, 1)        TRUE
  213. (80, 2)        
  214. (81, 0)        
  215. (81, 1)        TRUE
  216. (81, 2)        
  217. (82, 0)        
  218. (82, 1)        TRUE
  219. (82, 2)        
  220. (83, 0)        
  221. (83, 1)        TRUE
  222. (83, 2)        
  223. (84, 0)        
  224. (84, 1)        TRUE
  225. (84, 2)        
  226. (85, 0)        
  227. (85, 1)        TRUE
  228. (85, 2)        
  229. (86, 0)        
  230. (86, 1)        TRUE
  231. (86, 2)        
  232. (87, 0)        
  233. (87, 1)        TRUE
  234. (87, 2)        
  235. (88, 0)        
  236. (88, 1)        TRUE
  237. (88, 2)        If we didn't find one,
  238. (89, 0)        
  239. (89, 1)        TRUE
  240. (89, 2)             we set the error value 
  241. (90, 0)        
  242. (90, 1)        FALSE
  243. (90, 2)             and quit.
  244. (91, 0)        
  245. (91, 1)        TRUE
  246. (91, 2)        
  247. (92, 0)        
  248. (92, 1)        TRUE
  249. (92, 2)        
  250. (93, 0)        
  251. (93, 1)        TRUE
  252. (93, 2)        Return the left portion of the device name.
  253. (94, 0)        
  254. (94, 1)        TRUE
  255. (94, 2)        
  256. (95, 0)        
  257. (95, 1)        TRUE
  258. (95, 2)        
  259. (96, 0)        
  260. (96, 1)        TRUE
  261. (96, 2)        
  262. (97, 0)        
  263. (97, 1)        TRUE
  264. (97, 2)        
  265. (98, 0)        
  266. (98, 1)        TRUE
  267. (98, 2)        
  268. (100, 0)        
  269. (100, 1)        GetNewDevice
  270. (100, 2)        
  271. (101, 0)        
  272. (101, 1)        TRUE
  273. (101, 2)        
  274. (102, 0)        gnd.NewDeviceName
  275. (102, 1)        CB HP LaserJet II
  276. (102, 2)        
  277. (103, 0)        gnd.GetProfileString
  278. (103, 1)        1388904448
  279. (103, 2)        Register the API call.
  280. (104, 0)        
  281. (104, 1)        TRUE
  282. (104, 2)        Assume no errors.
  283. (105, 0)        gnd.printerName
  284. (105, 1)        ClikBook,LPT1
  285. (105, 2)        Ask WIN.INI for the current default printer
  286. (106, 0)        
  287. (106, 1)        TRUE
  288. (106, 2)        Unregister our API call to be polite.
  289. (107, 0)        
  290. (107, 1)        TRUE
  291. (107, 2)        Clear the name, to save memory.
  292. (108, 0)        
  293. (108, 1)        TRUE
  294. (108, 2)        If we couldn't find a match, 
  295. (109, 0)        
  296. (109, 1)        TRUE
  297. (109, 2)             set the errorNumber
  298. (110, 0)        
  299. (110, 1)        TRUE
  300. (110, 2)             and quit.
  301. (111, 0)        
  302. (111, 1)        FALSE
  303. (111, 2)        
  304. (112, 0)        
  305. (112, 1)        TRUE
  306. (112, 2)        Otherwise, return the new device string.
  307. (114, 0)        
  308. (114, 1)        HandleErrors
  309. (114, 2)        
  310. (115, 0)        
  311. (115, 1)        TRUE
  312. (115, 2)        
  313. (116, 0)        
  314. (116, 1)        TRUE
  315. (116, 2)        
  316. (117, 0)        
  317. (117, 1)        FALSE
  318. (117, 2)        
  319. (118, 0)        
  320. (118, 1)        TRUE
  321. (118, 2)        
  322. (119, 0)        
  323. (119, 1)        TRUE
  324. (119, 2)        
  325. (120, 0)        
  326. (120, 1)        TRUE
  327. (120, 2)        
  328. (121, 0)        
  329. (121, 1)        TRUE
  330. (121, 2)        
  331. (122, 0)        
  332. (122, 1)        TRUE
  333. (122, 2)        
  334. (123, 0)        
  335. (123, 1)        TRUE
  336. (123, 2)        
  337. (124, 0)        
  338. (124, 1)        TRUE
  339. (124, 2)        
  340. (125, 0)        
  341. (125, 1)        TRUE
  342. (125, 2)        
  343. (127, 0)        
  344. (127, 1)        PrintClickBook
  345. (127, 2)        
  346. (128, 0)        
  347. (128, 1)        FALSE
  348. (128, 2)        Get current recalc state
  349. (129, 0)        
  350. (129, 1)        FALSE
  351. (129, 2)        Turn off automatic recalc
  352. (130, 0)        
  353. (130, 1)        TRUE
  354. (130, 2)        
  355. (131, 0)        
  356. (131, 1)        TRUE
  357. (131, 2)        "HP LaserJet III,HPPCL5E, LPT1:"
  358. (132, 0)        
  359. (132, 1)        TRUE
  360. (132, 2)        
  361. (133, 0)        
  362. (133, 1)        FALSE
  363. (133, 2)        
  364. (134, 0)        
  365. (134, 1)        FALSE
  366. (134, 2)        
  367. (135, 0)        
  368. (135, 1)        TRUE
  369. (135, 2)        "HP LaserJet III"
  370. (136, 0)        
  371. (136, 1)        TRUE
  372. (136, 2)        
  373. (137, 0)        
  374. (137, 1)        FALSE
  375. (137, 2)        
  376. (138, 0)        
  377. (138, 1)        FALSE
  378. (138, 2)        
  379. (139, 0)        
  380. (139, 1)        TRUE
  381. (139, 2)        "LPT1:"
  382. (140, 0)        
  383. (140, 1)        TRUE
  384. (140, 2)        
  385. (141, 0)        
  386. (141, 1)        FALSE
  387. (141, 2)        
  388. (142, 0)        
  389. (142, 1)        FALSE
  390. (142, 2)        
  391. (143, 0)        
  392. (143, 1)        TRUE
  393. (143, 2)        "CB HP LaserJet III,ClickBook,LPT1:"
  394. (144, 0)        
  395. (144, 1)        TRUE
  396. (144, 2)        
  397. (145, 0)        
  398. (145, 1)        FALSE
  399. (145, 2)        
  400. (146, 0)        
  401. (146, 1)        FALSE
  402. (146, 2)        
  403. (147, 0)        
  404. (147, 1)        TRUE
  405. (147, 2)        "CB HP LaserJet III"
  406. (148, 0)        
  407. (148, 1)        TRUE
  408. (148, 2)        
  409. (149, 0)        
  410. (149, 1)        FALSE
  411. (149, 2)        
  412. (150, 0)        
  413. (150, 1)        FALSE
  414. (150, 2)        
  415. (151, 0)        
  416. (151, 1)        TRUE
  417. (151, 2)        "ClickBook"
  418. (152, 0)        
  419. (152, 1)        TRUE
  420. (152, 2)        
  421. (153, 0)        
  422. (153, 1)        FALSE
  423. (153, 2)        
  424. (154, 0)        
  425. (154, 1)        FALSE
  426. (154, 2)        
  427. (155, 0)        
  428. (155, 1)        TRUE
  429. (155, 2)        
  430. (156, 0)        
  431. (156, 1)        #N/A!
  432. (156, 2)        
  433. (157, 0)        
  434. (157, 1)        TRUE
  435. (157, 2)        
  436. (158, 0)        
  437. (158, 1)        FALSE
  438. (158, 2)        
  439. (159, 0)        
  440. (159, 1)        FALSE
  441. (159, 2)        
  442. (160, 0)        
  443. (160, 1)        TRUE
  444. (160, 2)        Turn off error message display.
  445. (161, 0)        pcb.PrintDialog
  446. (161, 1)        #VALUE!
  447. (161, 2)        Pop up the print dialog.
  448. (162, 0)        
  449. (162, 1)        TRUE
  450. (162, 2)        We'll get an error if there is an invalid port.
  451. (163, 0)        
  452. (163, 1)        TRUE
  453. (163, 2)        Force the error value, since we KNOW there's an error.
  454. (164, 0)        
  455. (164, 1)        TRUE
  456. (164, 2)        
  457. (165, 0)        
  458. (165, 1)        FALSE
  459. (165, 2)        
  460. (166, 0)        
  461. (166, 1)        TRUE
  462. (166, 2)        
  463. (167, 0)        
  464. (167, 1)        #N/A!
  465. (167, 2)        
  466. (168, 0)        
  467. (168, 1)        TRUE
  468. (168, 2)        
  469. (169, 0)        
  470. (169, 1)        FALSE
  471. (169, 2)        
  472. (170, 0)        
  473. (170, 1)        FALSE
  474. (170, 2)        
  475. (171, 0)        
  476. (171, 1)        
  477. (171, 2)        
  478. (172, 0)        pcb.Exit
  479. (172, 1)        TRUE
  480. (172, 2)        Clear out the memory we aren't using.
  481. (173, 0)        
  482. (173, 1)        TRUE
  483. (173, 2)        
  484. (174, 0)        
  485. (174, 1)        TRUE
  486. (174, 2)        
  487. (175, 0)        
  488. (175, 1)        TRUE
  489. (175, 2)        
  490. (176, 0)        
  491. (176, 1)        TRUE
  492. (176, 2)        
  493. (177, 0)        
  494. (177, 1)        TRUE
  495. (177, 2)        
  496. (178, 0)        
  497. (178, 1)        TRUE
  498. (178, 2)        
  499. (179, 0)        
  500. (179, 1)        FALSE
  501. (179, 2)        
  502. (180, 0)        
  503. (180, 1)        FALSE
  504. (180, 2)        
  505. (181, 0)        
  506. (181, 1)        
  507. (181, 2)        
  508.